<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.tryandcatch.net/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Ezequiel Espíndola's Blog : ASP.NET 2.0</title><link>http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx</link><description /><dc:language>en-US</dc:language><generator>CommunityServer 2.0 (Build: 60526.2668)</generator><item><title>ASP.NET 2.0: The &amp;quot;How Do I&amp;quot; Video Series</title><link>http://blogs.tryandcatch.net/eespindola/archive/2006/02/26/asp_net_2_0_how_do_i_video_series.aspx</link><pubDate>Sun, 26 Feb 2006 17:53:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:181</guid><dc:creator>eespindola</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/181.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=181</wfw:commentRss><description>A while ago I posted about &lt;a HREF="/eespindola/archive/2005/11/19/learning_asp_net_2_net_framework_2_.aspx"&gt;ASP.NET 2.0 learning resources&lt;/a&gt;. This post about &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/02/24/438953.aspx"&gt;ASP.NET 2.0 Membership, Roles, Forms Authentication and Security Resources&lt;/a&gt; pointed me to an excellent series of videos called &lt;a href="http://msdn.microsoft.com/asp.net/learning/learn/newtodevelopment/default.aspx"&gt;The “How Do I” Video Series&lt;/a&gt;. Be sure to check them.&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=181" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>Pattern to handle QueryString values on ASP.NET 2.0 pages</title><link>http://blogs.tryandcatch.net/eespindola/archive/2006/02/26/pattern_handle_values_from_querystring_asp_net_2_0.aspx</link><pubDate>Sun, 26 Feb 2006 15:09:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:180</guid><dc:creator>eespindola</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/180.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=180</wfw:commentRss><description>Here you have a good pattern to handle values from the QueryString on your ASP.NET 2.0 pages:&lt;br&gt;&lt;blockquote&gt;&lt;font face="Courier New"&gt;int _id = 0;&lt;br&gt;string id = Request.QueryString["id"];&lt;br&gt;if (!String.IsNullOrEmpty(id))&lt;br&gt;{ &lt;br&gt;&amp;nbsp; int.TryParse(id, out _id);&lt;br&gt;}&lt;/font&gt;&lt;br&gt;&lt;/blockquote&gt;For more information or to discuss about it go to &lt;a href="http://forums.commercestarterkit.org/forums/thread/2974.aspx"&gt;Getting IDs from the QueryString&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=180" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>Selecting a default item after a DataBound operation in ASP.NET 2.0</title><link>http://blogs.tryandcatch.net/eespindola/archive/2006/02/21/select_a_default_item_after_a_databound_operation_in_asp_net_2_0.aspx</link><pubDate>Tue, 21 Feb 2006 18:18:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:170</guid><dc:creator>eespindola</dc:creator><slash:comments>24</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/170.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=170</wfw:commentRss><description>When using the new DataSource objects you don’t need to write code for data binding. Code like this is not needed anymore:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;DropDownList1.DataSource = DataSet1;&lt;br&gt;DropDownList1.DataBind();&lt;br&gt;DropDownList1.Items.FindByValue(Request.QueryString[“state”]).Selected = true;&lt;/font&gt;&lt;br&gt;&lt;br&gt;You simply point the DataSourceID property of the DropDownList to a properly setup SqlDataSource or ObjectDataSource and voila! binding occurs behind scenes without need for code.&lt;br&gt;&lt;br&gt;However, how do you solve what comes after the call to DataBind(), the line that selects a current default value and could previously been in the Page_Load event or DataBind overridden method?&lt;br&gt;&lt;br&gt;The easy way to do it is to define a handler for the OnDataBound event that gets fired after the control has been databound.&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:DropDownList ID="DropDownList1" runat="server" DataSourceID="SqlDataSource1" DataTextField="Name" DataValueField="Id" OnDataBound="DropDownList1_DataBound" /&amp;gt;&lt;br&gt;&lt;br&gt;protected void DropDownList1_DataBound(object sender, EventArgs e)&lt;br&gt;{&lt;br&gt;&amp;nbsp; string selectedValue = Request.QueryString["id"];&lt;br&gt;&amp;nbsp; if (selectedValue != null)&lt;br&gt;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ListItem li = DropDownList1.Items.FindByValue(selectedValue);&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (li != null)&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; li.Selected = true;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;&amp;nbsp; }&lt;br&gt;}&lt;/font&gt;&lt;br&gt;&lt;br&gt;This simple code checks to see if a value has been passed through the QueryString and that it actually exists on the ListItemCollection of the DropDownList. If everything goes fine, the item for the value passed will be selected.&lt;br&gt;&lt;br&gt;Another related and interesting new feature of the controls derived from ListControl is the property “&lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.listcontrol.appenddatabounditems.aspx"&gt;AppendDataBoundItems&lt;/a&gt;”.&lt;br&gt;&lt;br&gt;In ASP.NET 1.x the DataBind operation always replaced the existing items, so you would have to bind items first and then add any custom values. You couldn’t specify them in a declarative way with an &amp;lt;asp:ListItem&amp;gt; tag on the page markup, but needed to add them programmatically. Now, &lt;a href="http://weblogs.asp.net/scottgu/archive/2006/01/29/436804.aspx"&gt;if you set AppendDataBoundItems=”true” the existing items are kept in the collection&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=170" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>New ASP.NET Starter Kit: eBay Selling Starter Kit</title><link>http://blogs.tryandcatch.net/eespindola/archive/2006/02/21/asp_net_2_0_ebay_selling_starter_kit.aspx</link><pubDate>Tue, 21 Feb 2006 11:09:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:162</guid><dc:creator>eespindola</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/162.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=162</wfw:commentRss><description>&lt;span id="PreviewBody"&gt;&lt;a href="http://weblogs.asp.net/scottgu/"&gt;Scott Guthrie&lt;/a&gt;
have been posting a ton of interesting content lately on his blog. I
found thru it that a new ASP.NET 2.0 Starter Kit is on the streets.
It's the &lt;a href="http://developer.ebay.com/windows/starterkits/"&gt;eBay Selling Starter Kit for VB.NET&lt;/a&gt;. I would say too bad if it's only in VB.NET, but I will download it anyway to take a look.&lt;br&gt;&lt;br&gt;Scott notes that this is different from the &lt;a href="http://www.commercestarterkit.org/"&gt;ASP.NET 2.0 PayPal-enabled Commerce Starter Kit&lt;/a&gt;.
I've been playing with the Commerce Starter Kit and can highly
recommend it. It's more like the lite version of a product than a
Starter Kit and a fun way to learn &lt;a href="http://www.asp.net/"&gt;ASP.NET 2.0&lt;/a&gt;.&lt;/span&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=162" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>Connection String Settings In ASP.NET 2.0</title><link>http://blogs.tryandcatch.net/eespindola/archive/2006/01/08/connection_string_settings_in_asp_net_2_0.aspx</link><pubDate>Sun, 08 Jan 2006 20:43:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:62</guid><dc:creator>eespindola</dc:creator><slash:comments>5</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/62.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=62</wfw:commentRss><description>There is a new configuration section for connection strings on ASP.NET 2.0 called &amp;lt;connectionStrings&amp;gt;. It is something so simple it seems dumb, but it helps to enforce recommended practices from the start. I really like this feature because of that.&lt;br&gt;&lt;br&gt;In ASP.NET 1.x you could put your connection string anywhere you like it. It was normally on the web.config’s AppSettings section, but there wasn’t any enforcement from the framework on where to put it or how to retrieve it.&lt;br&gt;&lt;br&gt;In ASP.NET 2.0 you can have all your connection strings on the &amp;lt;connectionStrings&amp;gt; section of the web.config, benefiting from centralized management and also enhanced security by encrypting them if you want.&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;connectionStrings&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="Pubs" connectionString="Server=(local);Integrated Security=True;Database=pubs;" providerName="System.Data.SqlClient" /&amp;gt;&lt;br&gt;&amp;nbsp; &amp;lt;/connectionStrings&amp;gt;&lt;br&gt;&amp;lt;/configuration&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;If you use these features, you can also make use of a new declarative expression that allows you to retrieve the Connection String by name and avoid hard-coding it on the page code.&lt;br&gt;&lt;br&gt;This tag would retrieve the Connection String setup above by its name, “Pubs”:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource1" runat="server"&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ConnectionString="&amp;lt;%$ ConnectionStrings:Pubs %&amp;gt;" /&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;And you can also specify an expression for the ProviderName property of SqlDataSource:&lt;br&gt;&lt;br&gt;&lt;font face="Courier New"&gt;&amp;lt;asp:SqlDataSource ID="SqlDataSource1" runat="server"&lt;br&gt;ConnectionString="&amp;lt;%$ ConnectionStrings:Pubs %&amp;gt;" &lt;br&gt;ProviderName="&amp;lt;%$ ConnectionStrings:Pubs.ProviderName %&amp;gt;" /&amp;gt;&lt;/font&gt;&lt;br&gt;&lt;br&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=62" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1004.aspx">.NET Framework 2.0</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1005.aspx">Web Development</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>ASP.NET 2.0 Compilation Model</title><link>http://blogs.tryandcatch.net/eespindola/archive/2005/12/09/asp_net_2_0_compilation_model.aspx</link><pubDate>Fri, 09 Dec 2005 22:06:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:55</guid><dc:creator>eespindola</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/55.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=55</wfw:commentRss><description>I'm still trying to discover all about the new ASP.NET 2.0 project
model. The fact that you don't need IIS, not even a Web Project makes
development so much faster and easier. There is no web project
actually, any folder can be a Web Site. This doesn't mean you should
grab your whole application and throw it inside the &lt;a href="http://blogs.tryandcatch.net/eespindola/archive/2005/12/07/app_code_and_bin_folders_making_code_accessible_from_your_pages.aspx"&gt;App_Code folder&lt;/a&gt;. Application layers should still be on their own class library projects and assemblies as necessary.&lt;br&gt;
&lt;br&gt;
I've found some interesting posts on the matter from &lt;a href="http://odetocode.com/blogs/scott/"&gt;Scott Allen&lt;/a&gt; where he explains that &lt;a href="http://odetocode.com/Blogs/scott/archive/2005/08/06/2048.aspx"&gt;contrary to be worse than in ASP.NET 1.x, the new compilation model is actually better&lt;/a&gt;. This relates to my post about the &lt;a href="http://blogs.tryandcatch.net/eespindola/archive/2005/12/06/asp_net_2_0_simplified_code_behind_model.aspx"&gt;ASP.NET 2.0 simplified code-behind model&lt;/a&gt;
and my question about why do you need an Inherits attribute on the
@Page declaration. As a matter of fact, you probably don't need it, it
should be named something else, like PartialClassName. As Scott
explains, the compilation model now takes both parts, aspx page and
code-behind and merge them into one assembly under the same Class name.
There is no inheritance going on there at least as I can see.&lt;br&gt;
&lt;br&gt;
In &lt;a href="http://odetocode.com/Blogs/scott/archive/2005/06/30/1889.aspx"&gt;another post&lt;/a&gt; he mades a point related to the &lt;a href="http://blogs.tryandcatch.net/jprizzo/archive/2005/12/06/how_to_speed_up_the_first_request_to_an_asp_net_page.aspx"&gt;ASP.NET Web Site Precompilation&lt;/a&gt; about how in some cases you would need to specify a @Reference directive to make things work. Take note.&lt;br&gt;
&lt;br&gt;
So far, I'm enjoying this stuff.&lt;br&gt;
&lt;br&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=55" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>App_Code &amp;amp; Bin Folders, Making Code Accessible from your Web Pages</title><link>http://blogs.tryandcatch.net/eespindola/archive/2005/12/07/app_code_and_bin_folders_making_code_accessible_from_your_pages.aspx</link><pubDate>Wed, 07 Dec 2005 19:34:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:49</guid><dc:creator>eespindola</dc:creator><slash:comments>0</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/49.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=49</wfw:commentRss><description>&lt;b&gt;The App_Code Folder&lt;/b&gt;&lt;br&gt;
&lt;br&gt;
There are a number of new App_NNN folders in &lt;b&gt;ASP.NET 2.0&lt;/b&gt; with special meaning. One of them is &lt;b&gt;App_Code&lt;/b&gt;.&lt;br&gt;
&lt;br&gt;
You might want to have some functionality accessible from many pages in
your application and think of using the Global.asax file or something
similar. Well, there is no Global.asax file by default anymore. You can
add it to your project if you want, but now it uses the &amp;lt;script&amp;gt;
syntax instead of a code-behind file. Besides, when you used it you had
to include an Import directive on every page of your application
referencing the namespace that contain the Global class.&lt;br&gt;
&lt;br&gt;
There is another option to have global access to functionality and data
in ASP.NET 2.0, the App_Code folder. This is a productive way of
sharing code between pages of your web application. You can place
source code files (.cs, .vb) in the App_Code folder and they will be
dynamically compiled into an assembly at run time. Any class you put in
the App_Code folder will be made directly accessible from anywhere in
the web application without the need of special references on the code
that uses it.&lt;br&gt;
&lt;br&gt;
In VS.NET 2005 if you add a new class from the Add New Item... dialog,
you get a screen asking to put the class into the App_Data folder and
if you answer yes and the folder is not there yet, it gets created.&lt;br&gt;
&lt;br&gt;
&lt;img src="/photos/eespindola/images/48/original.aspx" alt="New Class App_Code Dialog" title="New Class App_Code Dialog" align="middle" border="0" height="126" width="630"&gt;&lt;br&gt;
&lt;br&gt;
You can organize the code inside the App_Code folder anyway you like it
but no folder can contain class files of different languages. You don't
need to specify which language you are using, ASP.NET 2.0 will infer it
from the files itself. But, if you want to use more than one language
you have to use different subfolders. You'll need to specify this on
the web.config:&lt;br&gt;
&lt;br&gt;
&amp;lt;configuration&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;system.web&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;compilation&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;codeSubDirectories&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add directoryName="Subfolder1"/&amp;gt;&lt;br&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add directoryName="Subfolder2"/&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/codeSubDirectories&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/compilation&amp;gt;&lt;br&gt;
&amp;nbsp; &amp;lt;/system.web&amp;gt;&lt;br&gt;
&amp;lt;/configuration&amp;gt;&lt;br&gt;
&lt;br&gt;
This is necessary so ASP.NET treats the different folders as different
compilable units and puts them on different assemblies. Note that there
is no need to actually specify the language. It will still be inferred
from the files.&lt;br&gt;
&lt;br&gt;
You can also add other files that would generate a class like .wsdl,
.xsd, etc. and they will also be compiled into assemblies. If the
folder contains files that don't pertain to any programming language in
particular, i.e. all .xsd files, it will use the default compiler for
web applications established in the &lt;a href="http://msdn2.microsoft.com/en-us/library/s10awwz0.aspx"&gt;&amp;lt;compilation&amp;gt;&lt;/a&gt; configuration element.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;&lt;b&gt;
The Bin Folder&lt;/b&gt;&lt;br&gt;
&lt;br&gt;
The Bin directory is still there for compiled assemblies, but now it
doesn't get included in the web projects by default anymore. There is
no References special folder either and the web application is not
compiled into a DLL on the Bin folder at least while developing.&lt;br&gt;
&lt;br&gt;
The Bin folder is used to throw compiled assemblies and use them
without the need to register them. They are automatically loaded and
accessible. You still need to put some Import directives on pages or
using statements on code-behind classes though, or you'll get some
nasty errors.&lt;br&gt;
&lt;br&gt;&lt;p&gt;&lt;/p&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=49" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1004.aspx">.NET Framework 2.0</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item><item><title>ASP.NET 2.0 Simplified Code Behind Model</title><link>http://blogs.tryandcatch.net/eespindola/archive/2005/12/06/asp_net_2_0_simplified_code_behind_model.aspx</link><pubDate>Tue, 06 Dec 2005 18:45:00 GMT</pubDate><guid isPermaLink="false">88a9b5d4-3c06-45a1-b905-74a1e67c072c:46</guid><dc:creator>eespindola</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.tryandcatch.net/eespindola/comments/46.aspx</comments><wfw:commentRss>http://blogs.tryandcatch.net/eespindola/commentrss.aspx?PostID=46</wfw:commentRss><description>I knew about the existence of partial classes although I haven't read
much about them. It seems I will be using them a lot because ASP.NET
2.0 has the code-behind model simplified by its use.&lt;br&gt;
&lt;br&gt;
The advantage is that you don't need to declare in the code-behind
class the variables for the server controls lying on the page markup.
Remember all those protected variable declarations for the 100th server
controls you have on your page filling up the entire screen on the
code-behind class? No need for them anymore. =)&lt;br&gt;
&lt;br&gt;
Now you can access the server controls directly from the code-behind
class just by using the CodeFile and Inherits attributes in the &amp;lt;%@
Page %&amp;gt; directive:&lt;br&gt;
&lt;br&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true"&amp;nbsp; CodeFile="MyPage.aspx.cs" Inherits="MyPage" %&amp;gt;&lt;br&gt;
&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br&gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml" &amp;gt;&lt;br&gt;
&amp;lt;head runat="server"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;title&amp;gt;My Page&amp;lt;/title&amp;gt;&lt;br&gt;
&amp;lt;/head&amp;gt;&lt;br&gt;
&amp;lt;body&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;form id="form1" runat="server"&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:Label ID="MyLabel"
runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt;&amp;lt;/div&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/form&amp;gt;&lt;br&gt;
&amp;lt;/body&amp;gt;&lt;br&gt;
&amp;lt;/html&amp;gt;&lt;br&gt;
&lt;br&gt;
And having your code-behind class declared as a partial class:&lt;br&gt;
&lt;br&gt;public partial class MyPage : System.Web.UI.Page &lt;br&gt;
{&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; protected void Page_Load(object sender, EventArgs e)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyLabel.Text = "Hello ASP.NET 2.0!";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;br&gt;
&lt;br&gt;
You even get Intellisense everywhere while using VS.NET 2005. You'll
get all the methods and properties for the MyLabel control on the
code-behind class without even declaring that this is the partial class
for the page file that has the actual Label markup. It's kind of magic!
Well, actually it's the other way around (the page file declaring which
class file has
the code-behind) and VS.NET 2005 must know it. But, anyway...&lt;br&gt;
&lt;br&gt;
I don't know why is the Inherits attribute needed if this is the same
class sliced in pieces. I have to read more about partial classes.&lt;br&gt;
&lt;br&gt;&lt;img src="http://blogs.tryandcatch.net/aggbug.aspx?PostID=46" width="1" height="1"&gt;</description><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1003.aspx">ASP.NET</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1004.aspx">.NET Framework 2.0</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1005.aspx">Web Development</category><category domain="http://blogs.tryandcatch.net/eespindola/archive/category/1013.aspx">ASP.NET 2.0</category></item></channel></rss>