<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>ASP.NET 4.0</title>
        <link>http://geekswithblogs.net/rajeshpillai/category/10984.aspx</link>
        <description>asp.net 4</description>
        <language>en-US</language>
        <copyright>Rajesh Pillai</copyright>
        <managingEditor>thinkrajesh@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Tip : ASP.NET 4 Setting Client IDs</title>
            <link>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/settingclientid.aspx</link>
            <description>&lt;h1&gt;ASP.NET 4 Setting Client IDs&lt;/h1&gt;
&lt;p&gt;Another most wanted feature of asp.net 4 is the ability control client ID generation.  At least I am happy with this.  With prior&lt;br /&gt;
version of asp.net it was always difficult control the control id generation though not impossible.  Why is this important?  If you&lt;br /&gt;
can control ID generation then the markup size may dramatially reduce which may result in improved performance.  The gain&lt;br /&gt;
may around 15% reduction in terms of markup size in case of complicated nested pages.  &lt;/p&gt;
&lt;p&gt;The new ClientIDMode property addresses this long standing issue in ASP.NET.  Knowing the id attribute for rendered&lt;br /&gt;
elements are important if your application uses client script that references these elements.&lt;/p&gt;
&lt;p&gt;The new CLientIDMode property lets you specify more precisely how the client ID is generated for controls.  You can set the&lt;br /&gt;
ClientIDMode property for any control, including for the page.  Following are the possible settings&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;AutoID  &lt;br /&gt;
    This is the same as earlier versions of asp.net.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;Static  &lt;br /&gt;
    This specifies that the ClientID value will be the same as the ID without concatenating the IDs of parent naming&lt;br /&gt;
    containers.  This can be useful in Web user controls.  &lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;Predictable&lt;br /&gt;
    This option is primarily for use in data controls that use repeating templates.  It concatenates the ID properties&lt;br /&gt;
    of the control's naming containers, but generated ClientID values do not contain strings like "ctlxxx".  This setting&lt;br /&gt;
    works in conjuction with the ClientIDRowSuffix propertyof the control.  You set the ClientIDRowSuffix property to&lt;br /&gt;
    the name of a data field, and the vlaue of that field is used as the suffix for the generated ClientID value.  It's &lt;br /&gt;
    recommended to use the primary key of a data record as the ClientIDRowSuffix value.&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
    &lt;li&gt;Inherit&lt;br /&gt;
    This setting is the default behaviour for controls.  It specifie that a control's ID generation is the same as its parent.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;ClientIDMode can be set at the page or control level or in the configuration.  To set it at the page level refer the below example&lt;/p&gt;
&lt;p&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default"&lt;br /&gt;
                      ClientIDMode = "Predictbale" %&amp;gt;&lt;/p&gt;
&lt;p&gt;The following example shows hwo to To set it in the configuration file &lt;br /&gt;
&amp;lt;system.web&amp;gt;&lt;br /&gt;
       &amp;lt;pages clientIDMode ="Predictable"&amp;gt;&amp;lt;/pages&amp;gt;&lt;br /&gt;
&amp;lt;/system.web&amp;gt;&lt;/p&gt;
&lt;p&gt;For detailed reading refer&lt;br /&gt;
&lt;a href="http://www.asp.net/LEARN/whitepapers/aspnet4/default.aspx"&gt;www.asp.net/LEARN/whitepapers/aspnet4/default.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I have found this feature very handy.  Hope you will like it too.   &lt;br /&gt;
&lt;br /&gt;
Happy Programming !!!&lt;/p&gt; &lt;img src="http://geekswithblogs.net/rajeshpillai/aggbug/136592.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rajesh Pillai</dc:creator>
            <guid>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/settingclientid.aspx</guid>
            <pubDate>Sat, 28 Nov 2009 10:16:41 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rajeshpillai/comments/136592.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/settingclientid.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rajeshpillai/comments/commentRss/136592.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rajeshpillai/services/trackbacks/136592.aspx</trackback:ping>
        </item>
        <item>
            <title>Tip: ASP.NET 4 Permanently Redirecting a page</title>
            <link>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4-permanently-redirecting-a-page.aspx</link>
            <description>&lt;h1&gt;ASP.NET 4 Permanently Redirecting a page&lt;/h1&gt;
&lt;p&gt;You may have faced this problem of moving pages in a web applications around which can leat to an &lt;br /&gt;
accumulation of state links in search engines.  Traditionally developers have handled requests to old URL's by using&lt;br /&gt;
Response.Redirect method to forward request to new URL.  &lt;br /&gt;
&lt;br /&gt;
However as you may be aware of the Redirect method issues an HTTP 302 Found status (temporary redirect) response&lt;br /&gt;
, which results in an extra HTTP round trip to the server when users attempt to access the old URL's.  This has a performance&lt;br /&gt;
implication as well because of the round trip.&lt;br /&gt;
&lt;br /&gt;
ASP.NET 4 adds a new RedirectPermannent helper method which makes it easy to issue HTTP 301 Moved Permanently&lt;br /&gt;
responses.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: rgb(128, 128, 0);"&gt;&lt;em&gt;RedirectPermanent("/newlocation/oldcontent.aspx")&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
With this addition the search engines and other user agents that recognizse permanent redirects will store the new URL&lt;br /&gt;
that is associated with the content, which eliminates the unnecessary round trip made by the browser for temporary redirects.&lt;br /&gt;
&lt;br /&gt;
You can verify this by observing the request in the Fiddler.  For me I think this feature is pretty useful in migrating application&lt;br /&gt;
from old website to the new one.  Will definitely save a lot of headache.&lt;br /&gt;
 &lt;/p&gt; &lt;img src="http://geekswithblogs.net/rajeshpillai/aggbug/136591.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rajesh Pillai</dc:creator>
            <guid>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4-permanently-redirecting-a-page.aspx</guid>
            <pubDate>Sat, 28 Nov 2009 09:46:42 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rajeshpillai/comments/136591.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4-permanently-redirecting-a-page.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rajeshpillai/comments/commentRss/136591.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rajeshpillai/services/trackbacks/136591.aspx</trackback:ping>
        </item>
        <item>
            <title>Tip: ASP.NET 4.0 State Compression</title>
            <link>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4.0-state-compression.aspx</link>
            <description>&lt;h1&gt;ASP.NET 4.0 State Compression&lt;/h1&gt;
&lt;p&gt;Session state compression was always a worry in the past.  With asp.net 4.0 this feature is built into the framework.&lt;br /&gt;
Just modify your web.config with the following changes and you are ready to go.  Now there will be less data travelling &lt;br /&gt;
through the wire.&lt;/p&gt;
&lt;pre class="code_block"&gt;
&amp;lt;sessionState
  mode="SqlServer"
  sqlConnectionString="data source=dbserver;Initial Catalog=aspnetstate"
  allowCustomSqlDatabase="true"
  compressionEnabled="true"
/&amp;gt;
&lt;/pre&gt;
&lt;p&gt;Just add the "compressionEnabled="true" to sessionState config.  The compression is done by&lt;br /&gt;
.NET framework System.IO.Compression.GZipStream class.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt; &lt;/p&gt; &lt;img src="http://geekswithblogs.net/rajeshpillai/aggbug/136590.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Rajesh Pillai</dc:creator>
            <guid>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4.0-state-compression.aspx</guid>
            <pubDate>Sat, 28 Nov 2009 09:34:04 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rajeshpillai/comments/136590.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rajeshpillai/archive/2009/11/28/tip-asp.net-4.0-state-compression.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rajeshpillai/comments/commentRss/136590.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rajeshpillai/services/trackbacks/136590.aspx</trackback:ping>
        </item>
    </channel>
</rss>
