Home   |  Articles   |  Resources   |  Humor   |  Feedback

  Login   Register 

Ads Via DevMavens


.Net related Articles, Code and Resources
Herding Code Last Refreshed 7/3/2009 3:51:28 PM
MSDN: United States Last Refreshed 7/3/2009 3:51:29 PM
United States Global Headlines
Create and Customize Reports for Visual Studio Team Foundation Server
Learn important concepts about working with unfamiliar technologies and get step-by-step instructions on creating and customizing reports for Visual Studio Team Foundation Server.

Code Review: Find and Fix Vulnerabilities Before Your Application Ships
Discover the value of security code reviews performed by developers or security experts, and how an experienced reviewer can spot issues that would be missed by tools.

Manipulate Excel 2007 and PowerPoint 2007 Files with the Open XML Object Model
The Microsoft SDK for Open XML Formats Technology Preview is a library for accessing Open XML Format files. See the Open XML object model code that you can use to access and manipulate Excel 2007 and PowerPoint 2007 files.

Take Advantage of the Security Features in Windows Vista
Protect your customers from malware by creating applications that utilize the many defensive enhancements found in Windows Vista.

Best Practices: Common Coding Issues When Using the SharePoint Object Model
As more developers write custom code by using the SharePoint Object Model, they encounter common issues that can affect application performance. Here is how to identify and correct them.

Extend Windows PowerShell with Custom Commands
Windows PowerShell is a powerful and flexible tool that you can extend by writing your own custom cmdlets. Create three custom cmdlets that allow you to interact with IsolatedStorage.

Get a 90-Day Trial of Visual Studio 2008
Download a fully functional trial of Visual Studio 2008 to evaluate what’s new in this release of Visual Studio.

Build Applications for Facebook with the .NET Compact Framework
Use the .NET Compact Framework to build stand-alone smart device applications that can access Facebook content. The source code accompanying this article demonstrates working with key aspects of the Facebook API and tightly integrating with Microsoft Windows Mobile–specific APIs.

Encapsulate Silverlight with ASP.NET Controls
To implement Silverlight in ASP.NET pages, you can encapsulate your Silverlight elements in ASP.NET controls. Fritz Onion shows you how.

HTTP Programming with WCF and the .NET Framework 3.5

ASP.NET Podcast Last Refreshed 7/3/2009 3:51:30 PM
Podcast
ASP.NET Podcast Show #141 - Angel and Venture Financing for Technology Professionals with Rachael Qualls

Subscribe to Everything.

Subscribe to WMV.

Subscribe to M4V.

Subscribe to MP3.

Download WMV.

Download  M4V for iPod.

Download MP3.

Show Notes:

Personal Note from Wally: My favorite quote from the discussion: "We're not looking for an ad-based play." The reason why I love that quote is that I was involved with a startup for almost two years that thought that advertising was the way to get a company to profitability. For those numbers to work, they would have to generate 25,000,000 page views per month. No one at that time, including Google, was generating that number of page views for a map oriented site.  As you can guess, they did not survive.  I learned a lot about what it takes to build a company.


ASP.NET Podcast Show #140 - ASP.NET 4.0 Ajax Databinding

Subscribe to Everything.

Subscribe to WMV.

Subscribe to M4V.

Subscribe to MP3.

Download WMV.

Download M4V.

Download MP3.

Show Notes:

PS. I started getting sick about 5-10 minutes into the show, so if I sound somewhat confusing after that, I apologize.

Source Code:

<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="Content.aspx.cs" Inherits="TwitterApp.Content" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<asp:ScriptManager ID="sm" runat="server">

<Scripts>

<asp:ScriptReference ScriptMode="Inherit" Name="MicrosoftAjax.js" Path="~/js/MicrosoftAjax.js" />

<asp:ScriptReference ScriptMode="Inherit" Path="~/js/MicrosoftAjaxAdoNet.js" />

<asp:ScriptReference ScriptMode="Inherit" Path="~/js/MicrosoftAjaxTemplates.js" />

</Scripts>

<Services>

<asp:ServiceReference Path="~/TwitterService.svc" />

</Services>

</asp:ScriptManager>

<asp:TextBox ID="Status" runat="server"

TextMode="MultiLine" Rows="2" Columns="70" /><br />

<input type="button" ID="btnSubmit"

onclick="SubmitStatus()" value="Submit Status" />

<hr width="98%" />

<script language="javascript" type="text/javascript">

var userName = "More_Wally";

 

function SubmitStatus() {

var Status = $get('<%=Status.ClientID %>');

var userStatus = Status.value;

Status.value = "";

TwitterService.SubmitUserStatus(userName, userStatus,

TwitterPostCallBack);

}

function TwitterPostCallBack(result) {

TwitterService.GetUserTimeLine(userName,

TwitterServiceCallBack, TwitterServiceFailure);

}

var dv;

function pageLoad() {

var tblS = $get("tblStatus");

var uiElement = $get("twitterFriendsTimeLineListView");

dv = new Sys.UI.DataView(uiElement);

dv.add_itemCreated(fillExtra);

dv.initialize();

TwitterService.GetFriends(userName, StoreFriendsCallBack);

TwitterService.GetUserTimeLine(userName, TwitterServiceCallBack, TwitterServiceFailure);

}

var dd;

function StoreFriendsCallBack(result) {

dd = result;

}

function TwitterServiceCallBack(result) {

dv.set_data(result);

//dv.updated();

//tblStatus.style.visibility = "visible";

}

function FriendsCallBack(result, userCtx) {

dd = result;

DisplaySelect(dd, userCtx);

}

function DisplaySelect(data, userCtx) {

var i;

var opt;

var sel = $get("to" + userCtx.index);

sel.options.add(new Option("", ""));

for (i = 0; i < data.length; i++) {

opt = new Option(data[i].name, data[i].screen_name);

sel.options.add(opt);

}

}

var i = 0;

 

function fillExtra(sender, Args) {

var ctx = Args.get_templateContext();

var dt = Args.get_dataItem();

var strOut = "";

var strReturn = "<br />";

var Out = $get("Output");

var userCtx =

{

index: ctx.index

}

 

if (i == 0) {

strOut = "ctx<br />";

for (m in ctx) {

strOut += m + strReturn;

}

strOut += "<br/>ctx.nodes[0]<br />";

for (m in ctx.nodes[0]) {

strOut += m + strReturn;

}

strOut += "<br/>Data Item:<br />";

for (m in dt) {

strOut += m + strReturn;

}

Out.innerHTML = strOut;

}

i++;

if (dd == null) {

TwitterService.GetFriends("More_Wally", FriendsCallBack, null, userCtx);

}

else {

DisplaySelect(dd, userCtx);

}

}

function TwitterServiceFailure(result) {

alert("An error occurred");

}

function IterateDV() {

var count = dv.get_items().length;

var rw = "";

var controlId;

var ctx = dv.get_templateContext()

for (i = 0; i < count; i++) {

if (i == 0) {

//rw = dv.get_items()[i].elements[0].childNodes[2].childNodes[0].innerHTML;

rw = $get("Number" + i).innerHTML;

}

else {

rw += "," + $get("Number" + i).innerHTML;

}

}

alert(rw);

}

function SendMessage(i) {

var userName = "More_Wally";

var sendTo = $get("to" + i).value;

var userStatus = $get("message" + i).value;

TwitterService.DMSend(userName, sendTo, userStatus,

TwitterPostCallBack, TwitterServiceFailure);

}

String.prototype.parseURL = function() {

var URL = /[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+/;

var matches = this.match(URL);

var stringToReplace = this;

while (matches != null ) {

var m = matches[0];

var url = "<a href='" + m + "'>" + m + "</a>";

stringToReplace = stringToReplace.replace(m, url);

matches = stringToReplace.substring(stringToReplace.indexOf(url) +

url.length).match(URL);

}

return (stringToReplace);

};

String.prototype.parseUsername = function() {

var userName = /[@]+[A-Za-z0-9-_]+/;

var matches = this.match(userName);

var stringToReplace = this;

while ( matches != null ) {

var m = matches[0];

var finalMatch = m.replace("@", "");

var url = "<a href='http://twitter.com/" + finalMatch + "' target='_new'>" + m + "</a>";

stringToReplace = stringToReplace.replace(m, url);

matches = stringToReplace.substring(stringToReplace.indexOf(url) + url.length).match(userName);

};

return (stringToReplace);

};

String.prototype.parseHashtag = function() {

var hashTag = /[#]+[A-Za-z0-9-_]+/;

var matches = this.match(hashTag);

var stringToReplace = this;

while (matches != null) {

var m = matches[0];

var finalMatch = m.replace("#", "%23");

var url = "<a href='http://search.twitter.com/search?q=" + finalMatch +

"' target='_new'>" + m + "</a>";

stringToReplace = stringToReplace.replace(m, url);

matches = stringToReplace.substring(stringToReplace.indexOf(url) +

url.length).match(hashTag);

};

return (stringToReplace);

 

 

};

</script>

<input type="button" id="btnIterate"

value="Iterate" onclick="IterateDV()" />

<table>

<tr valign="top" align="left">

<td>

<table id="tblStatus" >

<thead>

<tr>

<th>

User Name

</th>

<th>

Status

</th>

<th>

Number

</th>

</tr>

</thead>

<tbody id="twitterFriendsTimeLineListView"

class="sys-template" >

<tr>

<td valign="top" align="left">

{{UserName}}<br />

<img sys:src="{{ ProfileImage }}" /><br />

<span style="font-size:smaller">

{{ StatusDate }}

</span>

</td>

<td valign="top" align="left">

<span code:after="$element.innerHTML=Status.parseURL().parseUsername().parseHashtag()" />

<!--{{Status.parseURL().parseUsername().parseHashtag()}}--></td>

<td>

<div sys:id="{{ 'Number' + $index }}">{{ $index }}</div>

<div code:if="($index % 2) == 0">even</div>

<div code:if="($index % 2) == 1">odd</div>

</td>

</tr>

<tr>

<td>

<select sys:id="{{ 'to' + $index }}" ></select>

<input type="text" sys:id="{{ 'message' + $index }}" size="50" />

</td>

<td>

<input type="button" sys:id="{{ 'btn' + $index }}"

value="Send a direct message" onclick="{{ 'SendMessage(' + $index + ')' }}" />

</td>

</tr>

<tr>

<td colspan="2">

2 way data binding<br />

{ binding Status }<br />

<input type="text" value="{ binding Status }" />

</td>

</tr>

<tr>

<td colspan="2">

<div code:before="if (i != 19) {" code:after="}">break</div>

<hr width="98%" code:if="$index != 19" />

</td>

</tr>

</tbody>

</table>

</td>

<td>

<div id="Output">

</div>

</td>

</tr>

</table>

</asp:Content>

 

Images:




The Blogs
Subscribe to the OdeToCode blogs for the latest news, downloads, new articles, and quirky commentary.
New Articles
Databinding in Silverlight
This article will cover data binding features in Silverlight, including binding expressions, validation, converters, and binding modes.

The Standard LINQ Operators
This article will cover the standard LINQ operators provided by LINQ for filtering, grouping, joining, converting, projecting, and more.

C# 3.0 and LINQ
C# 3.0 introduced a number of new features for LINQ. In this article we'll examine the new features like extension methods, lambda expressions, anonymous types, and more.

Most Popular Articles
Table Variables In T-SQL
Table variables allow you to store a resultset in SQL Server without the overhead of declaring and cleaning up a temporary table. In this article, we will highlight the features and advantages of the table variable data type.

ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps
MasterPages are a great addition to the ASP.NET 2.0 feature set, but are not without their quirks. This article will highlight the common problems developers face with master pages, and provide tips and tricks to use master pages to their fullest potential.

AppSettings In web.config
In this article we will review a couple of pratices to keep your runtime configuration information flexible.

Contribute Code
Privacy
Consultancy