<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8585812596977539454</id><updated>2010-07-01T12:29:00.990-07:00</updated><title type='text'>Dot Net Articles - aspnetr</title><subtitle type='html'>Asp.net, C#, vb.net, javascript, web service, xml, sql articles</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.aspnetr.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-5024496684529256442</id><published>2009-03-31T10:07:00.000-07:00</published><updated>2009-03-31T10:08:18.092-07:00</updated><title type='text'>Using jQuery with ASP.NET</title><content type='html'>In the first part of this article series I introduced jQuery’s functionality and how it provides a rich client side programming model. This time around I’ll expand on these concepts and show you how you can use jQuery in combination with ASP.NET using it as an AJAX backend to retrieve data. I’ll also discuss how you can create ASP.NET controls and otherwise interact with jQuery content from ASP.NET pages in WebForms.&lt;br /&gt;&lt;br /&gt;jQuery is just a JavaScript library so it will work seamlessly with ASP.NET both from page code as well as through backend driven code using the Page.ClientScript object or ScriptManager. You can use jQuery on its own as a client side and Ajax library that communicates with ASP.NET or you can use jQuery in combination with ASP.NET AJAX. The two actually complement each other quite well as jQuery provides functionality that the ASP.NET AJAX library does not and vice versa. For the most part the interaction between the two libraries is trouble free except for a few very rare edge cases.&lt;br /&gt;&lt;br /&gt;In this article I’m not going to be talking much about ASP.NET AJAX since that’s been covered ad finitum in other places – the procedure doesn’t vary much if you’re using it with jQuery. Instead I’ll focus on using only jQuery plus a few small helpers to make callbacks to the server easily. In the process you’ll get to see how some of jQuery’s AJAX features work and how to manage the data coming back from the server in a few different ways.&lt;br /&gt;First Ajax Steps with jQuery&lt;br /&gt;One of the most obvious client side features of any Javascript client library is the ability to make AJAX calls to the server. jQuery includes a host of Ajax functions that make it easy to retrieve content from a Url starting with the low level and do-everything $.ajax() function  plus a number of others that are simpler and more focused to specific tasks. Here’s a list of some of the functions available:&lt;br /&gt;&lt;br /&gt;$.ajax(opt)&lt;br /&gt;This the low level Ajax function with many, many options that lets you create just about any kind of Ajax request. If you need full control over requests or you want to create a generic component that calls back to the server (like the WCF/ASMX client proxy I’ll discuss later) you’ll want to use this function. For now check out the documentation on the multitude of options available.&lt;br /&gt;&lt;br /&gt;$(sel).load(url,data,callback)&lt;br /&gt;The .load() function is the only Ajax function that works off a jQuery selector. It calls a URL on the server and loads the result as content into selected element(s). It’s a very quick and easy way to load Html fragments and inject them into the document if your result is HTML. An optional callback can be provided to be notified with the server result text when the callback completes which is useful if you want to visually adjust the retrieved content – like applying an effect to visually cue the user to an update. Note this function is heavily overloaded: If no URL is specified .load() acts as a load event handler that fires when an element has loaded its data (ie. an image or script).&lt;br /&gt;&lt;br /&gt;$.get(url,callback),$.post(url,data,callback)&lt;br /&gt;These functions are simple helpers that provide basic get and post operations to the server. You specify a URL and a callback which is called with the HTTP response from the server. $.post() also allows you to pass either formatted POST buffer string or an object the properties of which are turned into POST encoded key value pairs.&lt;br /&gt;&lt;br /&gt;$.getJSON(url,data,callback)&lt;br /&gt;Similar to $.post(), but expects the result to be JSON which is automatically deserialized into a Javascript value and passed to the callback as a parameter. While this function is handy for simple JSON results there are two things to watch out for: Dates are not parsed since there’s no date literal in Javascript, so whatever the server returns will be used (typically a string). $.getJSON() also doesn’t support JSON POST data – only POST encoded variables. This function is useful for simple JSON results returned from arbitrary services, but not usable for calling WCF or ASMX ASP.NET services since they expect JSON POST input. More on this later in the article.&lt;br /&gt;&lt;br /&gt;.getJSON() also supports cross domain JSONP callbacks. If you specify a query string parameter of callback=? you can force the result to be routed to the callback you specify in the parameter list.&lt;br /&gt;&lt;br /&gt;$.getScript(url,callback)&lt;br /&gt;This function loads script code from the server and executes it once downloaded if no callback is specified. If specified the optional handler is fired instead and passed the Javascript, plus the current ajax request. This can be useful for JSONP cross domain callbacks where you have no control over the parameters used.&lt;br /&gt;&lt;br /&gt;Global Ajax Events&lt;br /&gt;There also a number of global Ajax events that you can take advantage of all of which take callbacks as parameters: ajaxCallback(), ajaxError(), ajaxSend(), ajaxStart(),ajaxStop(),ajaxSuccess(). These are useful for setting up global handlers that can centrally manage Ajax requests. You’re not likely to need these much unless you build components that need to know status of requests.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.west-wind.com/presentations/jQuery/jQueryPart2.aspx"&gt;Read More&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-5024496684529256442?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/5024496684529256442/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/using-jquery-with-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/5024496684529256442'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/5024496684529256442'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/using-jquery-with-aspnet.html' title='Using jQuery with ASP.NET'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-6475749472716887566</id><published>2009-03-30T08:46:00.003-07:00</published><updated>2009-03-30T08:46:01.234-07:00</updated><title type='text'>An Extensive Examination of LINQ: An Introduction to LINQ</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;a href='http://en.wikipedia.org/wiki/Language_Integrated_Query'&gt;LINQ&lt;/a&gt;, or &lt;b&gt;L&lt;/b&gt;anguage &lt;b&gt;IN&lt;/b&gt;tegrated &lt;b&gt;Q&lt;/b&gt;uery, is set of classes added to the .NET Framework 3.5&lt;br /&gt;along with language enhancements added to C# 3.0 and Visual Basic 9, the versions of the language that ship with Visual Studio 2008. LINQ adds a rich, standardized&lt;br /&gt;query syntax as a first-class citizen in .NET programming languages that allows developers to interact with any type of data.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Consider a typical data-driven application. There may be times when you are working with a database, displaying records or editing, inserting, and deleting data. Certain&lt;br /&gt;parts of the application may require retrieving certain elements from an XML file, or constructing an XML file based on user input. Or perhaps you have a collection of objects&lt;br /&gt;returned from a business object that you now want to work with by sorting them, computing the average value of a particular numeric property value, and displaying only those&lt;br /&gt;objects that meet a specified criteria. Prior to LINQ, working with each data source requires writing a different style of code. Moreover, working with external resources like&lt;br /&gt;data bases, XML files, and the like typically involves communicating with that external resource in some syntax specific to that resource. To retrieve data from a database you&lt;br /&gt;need to send it a string that contains the SQL query to execute; likewise, to work with a subset of XML elements in an XML document involves specifying an XPath expression&lt;br /&gt;in the form of a string. The idea is that using LINQ you can work with disparate data sources using a similar style without having to know a separate syntax for communicating &lt;br /&gt;with the data source (e.g., SQL or XPath) and without having to resort to passing opaque strings to external resources. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This article is the first in a series of articles that explores the goals of LINQ, its underpinnings, its syntax, and LINQ providers like LINQ to Objects, LINQ to XML, LINQ&lt;br /&gt;to SQL, and so forth. This inaugural article offers an overview of LINQ, looks at some simple examples of using the LINQ classes and syntax, and examines the core LINQ&lt;br /&gt;classes in the .NET Framework. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/021109-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-6475749472716887566?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/6475749472716887566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/6475749472716887566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/6475749472716887566'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq.html' title='An Extensive Examination of LINQ: An Introduction to LINQ'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-1787876529360319992</id><published>2009-03-30T08:46:00.001-07:00</published><updated>2009-03-30T08:46:00.374-07:00</updated><title type='text'>An Extensive Examination of LINQ: Extension Methods, Implicitly Typed Variables, and Object Initializers</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;One of the more substantive additions to the .NET Framework 3.5 and C# 3.0 and Visual Basic 9 languages was LINQ, a set of classes along with language enhancements that&lt;br /&gt;allow developers to use a common library and SQL-like query syntax to work with common data stores. The initial article in this series,&lt;br /&gt;&lt;a href='http://aspnet.4guysfromrolla.com/articles/021109-1.aspx'&gt;An Introduction to LINQ&lt;/a&gt;, provided an overview of LINQ and its core pieces: the standard query&lt;br /&gt;operators, the language extensions that allow for LINQ's query syntax, and LINQ providers. We also looked at some simple LINQ examples using both the standard query operators&lt;br /&gt;and the query syntax.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;LINQ's standard query operators - &lt;code&gt;Select&lt;/code&gt;, &lt;code&gt;Where&lt;/code&gt;, &lt;code&gt;OrderBy&lt;/code&gt;, &lt;code&gt;Average&lt;/code&gt;, and so on -  can be used as if they were instance methods&lt;br /&gt;of any object that implements &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;. For example, given a string array named &lt;code&gt;FileNames&lt;/code&gt; we can determine how many strings in the array start&lt;br /&gt;with the letter "S" by using the &lt;code&gt;Where&lt;/code&gt; and &lt;code&gt;Count&lt;/code&gt; standard query operators like so:&lt;br /&gt;&lt;/p&gt;&lt;table border='0'&gt;&lt;tr&gt;&lt;td bgcolor='#cccccc' width='100%'&gt;&lt;code&gt;&lt;br /&gt;string[] FileNames = { ... };&lt;br/&gt;&lt;br /&gt;int count = FileNames.&lt;span style='color:red;'&gt;Where(name =&amp;gt; name.StartsWith("S")).Count()&lt;/span&gt;;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;The &lt;code&gt;Where&lt;/code&gt; method and &lt;code&gt;Count&lt;/code&gt; methods look like they are members of the &lt;code&gt;Array&lt;/code&gt; class. However, they are defined in the &lt;br /&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.linq.enumerable.aspx'&gt;&lt;code&gt;Enumerable&lt;/code&gt; class&lt;/a&gt; in the &lt;br /&gt;&lt;a href='http://msdn.microsoft.com/en-us/library/system.linq.aspx'&gt;&lt;code&gt;System.Linq&lt;/code&gt; namespace&lt;/a&gt; as &lt;i&gt;extension methods&lt;/i&gt; on the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt;&lt;br /&gt;interface. Also note the syntax that is used to specify the input parameter for the Where method: &lt;code&gt;name =&amp;gt; name.StartsWith("S")&lt;/code&gt;. This syntax is a &lt;i&gt;lambda&lt;br /&gt;expression&lt;/i&gt; and provides a shorthand notation for developers to define a function.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This installment (and the next one) explore the language enhancements Microsoft made to C# 3.0 and Visual Basic 9 in more depth. (C# 3.0 and Visual Basic 9 are, at the time &lt;br /&gt;of this writing, the most recent versions of these two programming languages. They are the versions that were released with the .NET Framework 3.5 and Visual Basic 2008.)&lt;br /&gt;The key language enhancements that make LINQ possible include: extension methods; implicitly typed variables; object initializers; lambda expressions; and anonymous types.&lt;br /&gt;This article explores the first three of these language extensions; the latter two will be covered in the next installment. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/021809-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-1787876529360319992?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/1787876529360319992/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-extension.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/1787876529360319992'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/1787876529360319992'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-extension.html' title='An Extensive Examination of LINQ: Extension Methods, Implicitly Typed Variables, and Object Initializers'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-1838871875701654434</id><published>2009-03-30T08:45:00.009-07:00</published><updated>2009-03-30T08:45:58.490-07:00</updated><title type='text'>Using Expression Builders in ASP.NET</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;ASP.NET offers a variety of ways to inject the results of a server-side expression (such as &lt;code&gt;DateTime.Now.ToString()&lt;/code&gt;) into the rendered markup of an ASP.NET page. &lt;br /&gt;The most common way is to add a Label Web control to the page and then from the &lt;code&gt;Page_Load&lt;/code&gt; event handler (or some other suitable event handler) assign the value &lt;br /&gt;to display to the Label's &lt;code&gt;Text&lt;/code&gt; property. If you ever created web applications using ASP.NET's predecessor, classic ASP, or if you are familiar with &lt;br /&gt;&lt;a href='http://www.asp.net/mvc/'&gt;Microsoft's ASP.NET MVC&lt;/a&gt;, then you know that another way to inject server-side information is to add &lt;br /&gt;&lt;code&gt;&amp;lt;%= &lt;i&gt;expression&lt;/i&gt; %&amp;gt;&lt;/code&gt; to the declarative content like so:&lt;br /&gt;&lt;/p&gt;&lt;table border='0'&gt;&lt;tr&gt;&lt;td bgcolor='#cccccc' width='100%'&gt;&lt;code&gt;The current time is: &lt;span style='color:red;'&gt;&amp;lt;%= DateTime.Now.ToString() %&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;The &lt;code&gt;&amp;lt;%= &lt;i&gt;expression&lt;/i&gt; %&amp;gt;&lt;/code&gt; syntax is translated into &lt;code&gt;Response.Write(&lt;i&gt;expression&lt;/i&gt;)&lt;/code&gt;, injecting the value of &lt;i&gt;expression&lt;/i&gt; into the&lt;br /&gt;page's rendered output. Because &lt;code&gt;&amp;lt;%= &lt;i&gt;expression&lt;/i&gt; %&amp;gt;&lt;/code&gt; is translated into (essentially) a &lt;code&gt;Response.Write&lt;/code&gt; these statements cannot be used to set the values &lt;br /&gt;of Web control properties. In other words, you &lt;b&gt;cannot&lt;/b&gt; have markup like the following:&lt;br /&gt;&lt;/p&gt;&lt;table border='0'&gt;&lt;tr&gt;&lt;td bgcolor='#cccccc' width='100%'&gt;&lt;code&gt;&amp;lt;asp:Label runat="server" id="CurrentTime" Text="&amp;lt;%= DateTime.Now.ToString() %&amp;gt;" /&amp;gt;&lt;/code&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&lt;br /&gt;An alternate way to display server-side information is to assign it to a Web control property directly from the declarative markup using an &lt;i&gt;expression builder&lt;/i&gt;. An &lt;br /&gt;expression builder is denoted using the syntax &lt;code&gt;&amp;lt;%&lt;span style='color:red;'&gt;$&lt;/span&gt;&lt;i&gt;expression&lt;/i&gt; %&amp;gt;&lt;/code&gt; (note the &lt;code&gt;$&lt;/code&gt; after &lt;code&gt;&amp;lt;%&lt;/code&gt;). &lt;br /&gt;The &lt;i&gt;expression&lt;/i&gt; cannot be an arbitrary snippet of code as with &lt;code&gt;&amp;lt;%= ... %&amp;gt;&lt;/code&gt;, but instead is limited to what expression builders the website is configured&lt;br /&gt;to use. Moreover, expression builders must be assigned to a Web control property; they cannot appear in any which place in the declarative markup like &lt;code&gt;&amp;lt;%= &lt;i&gt;expression&lt;/i&gt; %&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;ASP.NET ships with three built-in expression builder classes that let you declaratively access the values in the configuration's &lt;code&gt;AppSettings&lt;/code&gt; collection, the &lt;br /&gt;&lt;code&gt;ConnectionStrings&lt;/code&gt; collection, and in the website's resources (typically defined in the &lt;code&gt;App_LocalResources&lt;/code&gt; and &lt;code&gt;App_GlobalResources&lt;/code&gt; folders). &lt;br /&gt;With a little bit of code you can create your own expression builders. This article provides an overview of how expression builders work and shows how to create your &lt;br /&gt;own expression builders. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/022509-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-1838871875701654434?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/1838871875701654434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/using-expression-builders-in-aspnet.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/1838871875701654434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/1838871875701654434'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/using-expression-builders-in-aspnet.html' title='Using Expression Builders in ASP.NET'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-7786274676918008862</id><published>2009-03-30T08:45:00.007-07:00</published><updated>2009-03-30T08:45:57.376-07:00</updated><title type='text'>skmExpressionBuilders - A Suite of Custom Expression Builder Classes</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;An ASP.NET Web control's properties can be set in one of two ways: declaratively and programmatically. Declaratively setting a Web control's properties entails specifying&lt;br /&gt;the property in the control's declarative syntax. For example, Web controls have their &lt;code&gt;ID&lt;/code&gt; property set declaratively, like so:&lt;br /&gt;&lt;code&gt;&amp;lt;asp:&lt;i&gt;WebControl&lt;/i&gt; runat="server" &lt;span style='color:red;'&gt;ID="&lt;i&gt;ID&lt;/i&gt;"&lt;/span&gt; ... /&amp;gt;&lt;/code&gt;. Properties can also be set programmatically in the ASP.NET&lt;br /&gt;page's code-behind class. If you need to set a Web control's property to some dynamic value you may think you need to set it programmatically. However, this is not the case.&lt;br /&gt;&lt;i&gt;Expression builders&lt;/i&gt; make it possible to assign a dynamic value to a Web control property through the declarative syntax.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Last week's article, &lt;a href='http://aspnet.4guysfromrolla.com/articles/022509-1.aspx'&gt;Using Expression Builders in ASP.NET&lt;/a&gt;, examined the ins and outs of expression&lt;br /&gt;builders, their syntax, and how to use them in an ASP.NET page. ASP.NET ships with three built-in expression builder classes: &lt;code&gt;AppSettingsExpressionBuilder&lt;/code&gt;,&lt;br /&gt;which retrieves a value from the &lt;code&gt;&amp;lt;appSettings&amp;gt;&lt;/code&gt; section defined in &lt;code&gt;Web.config&lt;/code&gt;; &lt;code&gt;ConnectionStringsExpressionBuilder&lt;/code&gt;, which retrieves a &lt;br /&gt;value from the &lt;code&gt;&amp;lt;connectionStrings&amp;gt;&lt;/code&gt; section; and &lt;code&gt;ResourceExpressionBuilder&lt;/code&gt;, which retrieves a resource value. These expression builders can be&lt;br /&gt;used in the declarative markup using syntax similar to the following: &lt;code&gt;&amp;lt;asp:Label runat="server" id="Copyright" Text="&lt;span style='color:red;'&gt;&amp;lt;%$ AppSettings:CopyrightNotice &lt;br /&gt;%&amp;gt;"&lt;/span&gt; /&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;With a little bit of elbow grease you can create your own custom expression builder classes. I've spent some time creating a handful of custom expression builder classes,&lt;br /&gt;which I've packaged into a class library named skmExpressionBuilders. This article walks through the custom expression builders in this library and shows how to use them in&lt;br /&gt;your ASP.NET application. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/030409-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-7786274676918008862?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/7786274676918008862/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/skmexpressionbuilders-suite-of-custom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/7786274676918008862'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/7786274676918008862'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/skmexpressionbuilders-suite-of-custom.html' title='skmExpressionBuilders - A Suite of Custom Expression Builder Classes'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-779476282199927773</id><published>2009-03-30T08:45:00.005-07:00</published><updated>2009-03-30T08:45:56.392-07:00</updated><title type='text'>An Extensive Examination of LINQ: Lambda Expressions and Anonymous Types</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;The previous installment in this article series, &lt;a href='http://aspnet.4guysfromrolla.com/articles/021809-1.aspx'&gt;Extension Methods, Implicitly Typed Variables, and Object &lt;br /&gt;Initializers&lt;/a&gt;, examined three new features to the C# 3.0 and Visual Basic 9 languages that allow for developers to use LINQ's standard query operators and providers to &lt;br /&gt;write SQL-like query syntax to work with common data stores. But extension methods, implicitly typed variables, and object initializers are only part of the story. Two additional&lt;br /&gt;language features - lambda expressions and anonymous types - are also essential ingredients in LINQ's unique syntax.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Recall that LINQ's standard query operators can work with any collection of data that implements the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface. Some of the standard query &lt;br /&gt;operators perform rather straightforward operations on the collection; the &lt;code&gt;Count&lt;/code&gt; standard query operator, for instance, simply returns the number of elements &lt;br /&gt;in the collection. However, other standard query operators are more flexible, allowing the page developer to dictate how the operator will work. The &lt;code&gt;Where&lt;/code&gt; standard query&lt;br /&gt;operator is such an example - it filters the elements in the collection based on a developer-specified filtering method. But just how can a developer "pass" a method to the&lt;br /&gt;&lt;code&gt;Where&lt;/code&gt; standard query operator as an input parameter? The .NET Framework has long supported the notion of delegates, which are type-safe function pointers. However, &lt;br /&gt;the syntax for delegates is a little confusing and verbose. Lambda expressions offer a much more terse syntax for defining an anonymous method.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Anonymous types allow for inline types. In a nutshell, anonymous types let you clump a set of values together into a new type without having to first declare the type&lt;br /&gt;via a class. For example, imagine that you have a collection of &lt;code&gt;Employee&lt;/code&gt; objects, where each &lt;code&gt;Employee&lt;/code&gt; object has properties like &lt;code&gt;Name&lt;/code&gt;, &lt;br /&gt;&lt;code&gt;Salary&lt;/code&gt;, &lt;code&gt;HireDate&lt;/code&gt;, and so on. You may want to apply some filtering condition on this collection using the &lt;code&gt;Where&lt;/code&gt; standard query operator and&lt;br /&gt;then &lt;i&gt;project&lt;/i&gt; the collection of &lt;code&gt;Employee&lt;/code&gt; objects into a collection of objects that includes just the &lt;code&gt;Name&lt;/code&gt; and &lt;code&gt;Salary&lt;/code&gt; properties.&lt;br /&gt;With anonymous types this style of projection is straightforward and natural. Without anonymous types you would first have to create a class like &lt;code&gt;EmployeeSimplified&lt;/code&gt; &lt;br /&gt;that contained only those two properties of interest.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;This article provides an overview of lambda expressions and anonymous types. These two language enhancements, along with extension methods, implicitly typed variables, and object &lt;br /&gt;initializers, are what allows for LINQ's query syntax. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/031109-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-779476282199927773?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/779476282199927773/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-lambda.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/779476282199927773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/779476282199927773'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-lambda.html' title='An Extensive Examination of LINQ: Lambda Expressions and Anonymous Types'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-5275621400930606401</id><published>2009-03-30T08:45:00.003-07:00</published><updated>2009-03-30T08:45:55.565-07:00</updated><title type='text'>Syndicating and Consuming RSS 1.0 (RDF) Feeds in ASP.NET 3.5</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;Websites that produce new content on a regular basis should include a &lt;i&gt;syndication feed&lt;/i&gt;, which is a specially formatted XML file that includes a summary of the most recently&lt;br /&gt;published items. Virtually all blogs, news sites, and social media sites have a syndication feed, and 4Guys is no exception. The &lt;br /&gt;&lt;a href='http://aspnet.4guysfromrolla.com/rss/rss.aspx'&gt;4GuysFromRolla.com syndication feed&lt;/a&gt; contains the most recent articles. Syndication feeds are meant to be &lt;br /&gt;consumed by computers. Sites like &lt;a href='http://technorati.com/'&gt;Technorati&lt;/a&gt; parse the syndication feeds from blogs and use that data to determine the topic du jour. &lt;br /&gt;Also, syndication feeds are commonly used by websites to display the latest headlines from related sites. For example, an ASP.NET community website could consume &lt;br /&gt;the 4GuysFromRolla.com syndication feed to display the latest 4Guys headlines. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Until recently, there was no built-in support for creating or consuming syndication feeds in the .NET Framework. That changed with the release of the .NET Framework version&lt;br /&gt;3.5, which included a new namespace: &lt;a href='http://msdn.microsoft.com/en-us/library/system.servicemodel.syndication.aspx'&gt;&lt;code&gt;System.ServiceModel.Syndication&lt;/code&gt;&lt;/a&gt;. &lt;br /&gt;This new namespace includes a handful of classes for working with syndication feeds. As aforementioned, syndication feeds are XML files, and for the syndication feed to be &lt;br /&gt;of any use it must conform to one of the popular syndication feed standards. The two most popular syndication feed standards are &lt;br /&gt;&lt;a href='http://en.wikipedia.org/wiki/RSS_%28file_format%29'&gt;RSS 2.0&lt;/a&gt; and &lt;a href='http://en.wikipedia.org/wiki/Atom_%28standard%29'&gt;Atom 1.0&lt;/a&gt;, and these are the standards&lt;br /&gt;supported by the classes in the &lt;code&gt;System.ServiceModel.Syndication&lt;/code&gt; namespace. But there is a third format that, while not as popular as RSS 2.0 or Atom 1.0, is still&lt;br /&gt;used. That standard is RSS 1.0.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;The good news is that with a little bit of work we can create a class that works with the RSS 1.0 standard and have this class used by the syndication feed-related classes in&lt;br /&gt;the .NET Framework 3.5 can be. This article introduces a free library, skmFeedFormatters, which you can use in an ASP.NET 3.5 application to create and consume RSS 1.0 feeds.&lt;br /&gt;(This same concept could be applied to creating and parsing Atom 0.3 feeds, as well.) Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/031809-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-5275621400930606401?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/5275621400930606401/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/syndicating-and-consuming-rss-10-rdf.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/5275621400930606401'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/5275621400930606401'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/syndicating-and-consuming-rss-10-rdf.html' title='Syndicating and Consuming RSS 1.0 (RDF) Feeds in ASP.NET 3.5'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8585812596977539454.post-3881895565155441082</id><published>2009-03-30T08:45:00.001-07:00</published><updated>2009-03-30T08:45:53.916-07:00</updated><title type='text'>An Extensive Examination of LINQ: The Ins and Outs of Query Operators</title><content type='html'>&lt;div xmlns='http://www.w3.org/1999/xhtml'&gt;&lt;p&gt;&lt;br /&gt;As discussed in &lt;a href='http://aspnet.4guysfromrolla.com/articles/021109-1.aspx'&gt;An Introduction to LINQ&lt;/a&gt;, LINQ is composed of three main components:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Language Extensions,&lt;/li&gt;&lt;li&gt;Standard Query Operators, and&lt;/li&gt;&lt;li&gt;LINQ Providers.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;br /&gt;The previous two installments - &lt;a href='http://aspnet.4guysfromrolla.com/articles/021809-1.aspx'&gt;Extension Methods, Implicitly Typed Variables, and Object Initializers&lt;/a&gt; and&lt;br /&gt;&lt;a href='http://aspnet.4guysfromrolla.com/articles/031109-1.aspx'&gt;Lambda Expressions and Anonymous Types&lt;/a&gt; - explored the language extensions added to C# 3.0 and Visual Basic&lt;br /&gt;9 that allow for LINQ's unique syntax. But these language extensions are merely syntactic sugar; they make it possible for developers to write more concise and readable code, but&lt;br /&gt;they don't actually perform any operations. The real workhorse of LINQ is the standard query operators.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;LINQ's standard query operators are a collection of &lt;i&gt;query operators&lt;/i&gt;. Query operators are methods that walk through a sequence of data and perform some task based&lt;br /&gt;on that data, and are implemented as extension methods on the &lt;code&gt;IEnumerable&amp;lt;T&amp;gt;&lt;/code&gt; interface. We've already seen a handful of standard query operators in use in &lt;br /&gt;previous installments, such as &lt;code&gt;Where&lt;/code&gt;, &lt;code&gt;Count&lt;/code&gt;, and &lt;code&gt;Average&lt;/code&gt;. This article explores the inner workings of query operators, which is essential&lt;br /&gt;to understanding how LINQ's standard query operators work. Read on to learn more!&lt;br /&gt;&lt;br/&gt;&lt;a class='readmore' href='http://aspnet.4guysfromrolla.com/articles/032509-1.aspx'&gt;Read More &amp;gt;&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8585812596977539454-3881895565155441082?l=www.aspnetr.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://www.aspnetr.com/feeds/3881895565155441082/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-ins-and.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/3881895565155441082'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8585812596977539454/posts/default/3881895565155441082'/><link rel='alternate' type='text/html' href='http://www.aspnetr.com/2009/03/extensive-examination-of-linq-ins-and.html' title='An Extensive Examination of LINQ: The Ins and Outs of Query Operators'/><author><name>Ludmal De Silva</name><uri>http://www.blogger.com/profile/08871386763862827832</uri><email>noreply@blogger.com</email><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='OpenSocialUserId' value='15824924031765880460'/></author><thr:total>0</thr:total></entry></feed>