<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/"><channel><title>ASP.NET</title><link>http://blogs.x2line.com/al/category/5.aspx</link><description>Posts focused solely on ASP.NET. This including best practices, configuration considerations, controls development, custom HTTP handlers and modules, ASP.NET web services. Also: advanced technologies such as WSE for asmx, url rewriting, caching practices and hands-on code examples.</description><managingEditor>Anatoly Lubarsky</managingEditor><dc:language>en-US</dc:language><generator>Version 0.97.2006.1</generator><image><url>http://blogs.x2line.com/Images/x2line_logo_feed.jpg</url><title>x2line: Social Network Services, Weblog Hosting</title><link>http://blogs.x2line.com/</link></image><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET: How to Bind RSS Feed To Repeater</title><link>http://blogs.x2line.com/al/archive/2008/06/21/3469.aspx</link><pubDate>Sat, 21 Jun 2008 14:18:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2008/06/21/3469.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/3469.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2008/06/21/3469.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/3469.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/3469.aspx</trackback:ping><description>&lt;p&gt;Repeater seems to be the easiest, light, most simple and generic control in ASP.NET to render repeated items. For example in data driven applications it is easy to render table contents (i.e. table rows) with Repeater. All developer needs to do is to bind a custom class collection, Array, List&lt;t&gt; or whatever to the Repeater.&lt;/t&gt;&lt;/p&gt;&lt;br&gt;
&lt;p&gt;However one can feel some lack of support in Repeater for RSS feeds in other words it is not easy to bind repeated to dynamic online XML structure like RSS.&lt;/p&gt;&lt;br&gt;
&lt;p&gt;Below I tried to demonstrate a small and simple example of how to bind RSS feed to ASP.NET Repeater control on the fly. It's implemented as a control which we can drop anywhere on ASP.NET page.&lt;/p&gt;&lt;br&gt;
&lt;pre&gt;&lt; %@ Control Language="c#" AutoEventWireup="true" EnableViewState="false" %&gt;
&lt; %@ Import namespace="System.Xml" %&gt;
&lt; script runat="server" language="C#"&gt;
    public string rssUrl = "http://blogs.x2line.com/al/rss.aspx";
    private System.Xml.XmlDocument doc;
   
    public override void DataBind()
    {
        doc = new System.Xml.XmlDocument();
        doc.Load(rssUrl);
         
        base.DataBind();
    }
         
    public void Page_Load(System.Object s, System.EventArgs e)
    {
        this.DataBind();
    }
&lt; /script&gt;

&lt; asp:Repeater 
    runat="server" 
    id="rptrRss" 
    DataSource='&lt; %# doc.SelectNodes("/rss/channel/item[position()&lt;=5]") %&gt;'&gt;
    &lt; HeaderTemplate&gt;
        &lt; div&gt;
            &lt; a href='&lt; %# doc.SelectSingleNode("/rss/channel/image/link").InnerText %&gt;'&gt;
            &lt; img 
                src='&lt; %# doc.SelectSingleNode("/rss/channel/image/url").InnerText %&gt;' 
                alt='&lt; %# doc.SelectSingleNode("/rss/channel/image/title").InnerText %&gt;' /&gt;
            &lt; /a&gt;
    &lt; /HeaderTemplate&gt;
    &lt; ItemTemplate&gt;
        &lt; a 
            href='&lt; %# (Container.DataItem as XmlNode)["link"].InnerText %&gt;'&gt;
            &lt; %# (Container.DataItem as XmlNode)["title"].InnerText %&gt;
            (&lt; %# (Container.DataItem as XmlNode).SelectSingleNode("author |
title[not(../author)]").InnerText %&gt;)
        &lt; /a&gt;
    &lt; /ItemTemplate&gt;
    &lt; FooterTemplate&gt; 
        &lt; /div&gt;
    &lt; /FooterTemplate&gt;
&lt; /asp:Repeater&gt;
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;Maybe useful to make widgets. Enjoy :)&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/3469.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET tip: Autonumber Rows in ASP.NET Repeater control</title><link>http://blogs.x2line.com/al/archive/2008/04/26/3408.aspx</link><pubDate>Sat, 26 Apr 2008 02:37:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2008/04/26/3408.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/3408.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2008/04/26/3408.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/3408.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/3408.aspx</trackback:ping><description>&lt;p&gt;Q: How to print the current row number in an ASP.NET Repeater control ?&lt;/p&gt;&lt;br&gt;
&lt;p&gt;A: The easiest way to autonumber rows in Repeater is to use markup or ItemDataBound event. Since each row has ItemIndex property when created/bounded. Therefore for Repeater markup one can write the following:&lt;/p&gt;&lt;br /&gt;
&lt;pre&gt;
&lt; ItemTemplate&gt;
    &lt; %# Container.ItemIndex + 1 %&gt;
&lt; /ItemTemplate&gt;
&lt;/pre&gt;&lt;br /&gt;
&lt;p&gt;Or in the ItemDataBound event (for more complex rendering) this should look like so:&lt;/p&gt;&lt;br /&gt;
&lt;pre&gt;
if ((e.Item.ItemType == ListItemType.AlternatingItem) || 
    (e.Item.ItemType == ListItemType.Item))
{
    int num = e.Item.ItemIndex + 1;

    // some code
}
&lt;/pre&gt;&lt;br /&gt;
&lt;p&gt;Enjoy :)&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/3408.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET Tip: How to Implement P3P HTTP Headers</title><link>http://blogs.x2line.com/al/archive/2007/09/27/3282.aspx</link><pubDate>Thu, 27 Sep 2007 23:37:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/09/27/3282.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/3282.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/09/27/3282.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/3282.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/3282.aspx</trackback:ping><description>&lt;h4&gt;The Problem&lt;/h4&gt;
&lt;p&gt;Q: Why "make sure to implement P3P if using iframes" ?&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;A: If your application is inside iframe with parent belongs to another domain - cookies will not work for some very common configurations for example IE 6/7 with privacy set to medium. If cookies don't work - session won't work.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;Therefore session state turns out useless for your application under Internet Explorer. See - &lt;a href="http://msdn2.microsoft.com/en-us/library/ms537343.aspx"&gt;Privacy in Internet Explorer 6&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;This is relevant when domain that hosts iframe is different from parent domain. Because of the fact that this is not very common scenario - only a few familiar with the solution.&lt;/p&gt;&lt;br /&gt;
&lt;h4&gt;The Solution&lt;/h4&gt;
&lt;p&gt;Solution - need to implement P3P header to tell the browser that cookies for your application inside iframe are OK for user privacy.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;So, ASP.NET implementation may look like the following (global.asax):&lt;/p&gt;&lt;br /&gt;
&lt;pre&gt;
protected void Application_BeginRequest(Object sender, EventArgs e)
{
    //
    HttpContext.Current.Response.AddHeader("p3p", "CP=\"CAO PSA OUR\"");
}
&lt;/pre&gt;&lt;br /&gt;
&lt;p&gt;BTW, Safari won't accept cross-domain cookies even with the P3P headers.&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/3282.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>Why "aspnet_regiis -i" is Bad Practices</title><link>http://blogs.x2line.com/al/archive/2007/07/15/3203.aspx</link><pubDate>Sun, 15 Jul 2007 00:55:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/07/15/3203.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/3203.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/07/15/3203.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/3203.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/3203.aspx</trackback:ping><description>&lt;p&gt;Many times we come across incompatibility of ASP.NET application version and ASP.NET version installed by default on the production machine. I came across this issue twice today browsing the net. It can be either ASP.NET 1.1 application which is about to be installed on IIS with only ASP.NET 2.0 installed or 32 bit application which is about to be installed on 64 bit machine or whatever.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;In the forums and all over the search engines the most common solution (for almost 5 years) is to use &lt;b&gt;aspnet_regiis -i&lt;/b&gt; in order to re-register ASP.NET on the machine. &lt;b&gt;aspnet_regiis -i&lt;/b&gt; is quoted many times in FAQ sections of technology forums.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;However it will be bad practices to use "-i" switch since it installs the specific version of ASP.NET and registers script maps to the root of the default Web Site and recursively to all virtual directories below the root. This way it can break existing applications installed or others that will be installed in the future.&lt;/p&gt;&lt;br /&gt;
&lt;p&gt;The right way to use &lt;b&gt;aspnet_regiis&lt;/b&gt; in order to update script maps for the specific installed application will be like so:&lt;/p&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;&lt;i&gt;aspnet_regiis -ir -enable&lt;/i&gt; - Installs ASP.NET version with root and enables it.&lt;/li&gt;
&lt;li&gt;&lt;i&gt;aspnet_regiis -s path&lt;/i&gt; - Registers script map for our Application.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;
&lt;p&gt;This way our registration will not affect other applications on the machine.&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/3203.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET: HtmlHead ControlAdapters implementation</title><link>http://blogs.x2line.com/al/archive/2007/01/31/2816.aspx</link><pubDate>Wed, 31 Jan 2007 01:51:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/31/2816.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2816.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/31/2816.aspx#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2816.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2816.aspx</trackback:ping><description>&lt;p&gt;Here I want to show my implementation of &lt;i&gt;ControlAdapters&lt;/i&gt; to render &lt;i&gt;HtmlHead&lt;/i&gt; element properly in ASP.NET (at least as far as I can see it :)). For reference see my previous entries on the issue:&lt;/p&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;
&lt;a title="Override HtmlHead Rendering with ControlAdapters" href="http://blogs.x2line.com/al/archive/2007/01/31/2814.aspx" target="_blank"&gt;Override HtmlHead Rendering with ControlAdapters&lt;/a&gt;.&lt;/li&gt; &lt;li&gt;&lt;a title="MasterPage HtmlHead Renders Messy HTML" href="http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx" target="_blank"&gt;MasterPage HtmlHead Renders Messy HTML&lt;/a&gt;.&lt;/li&gt; &lt;/ul&gt;&lt;br&gt; &lt;p&gt;And here is &lt;a title="original implementation of Control Adapters" href="http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx#2812" target="_blank"&gt;original implementation of Control Adapters&lt;/a&gt; by &lt;a title="Bazile" href="http://relib.com/blogs/bazile/" target="_blank"&gt;Bazile&lt;/a&gt;.&lt;/p&gt;&lt;br&gt; &lt;p&gt;So in order to render &lt;i&gt;HtmlHead&lt;/i&gt; need to implement the following Control Adapters and register them in &lt;i&gt;Default.browser&lt;/i&gt;:&lt;/p&gt;&lt;br&gt; &lt;ol&gt; &lt;li&gt;&lt;i&gt;HtmlHeadAdapter&lt;/i&gt;  &lt;pre&gt;public class HtmlHeadAdapter : System.Web.UI.Adapters.ControlAdapter
{
    protected override void Render(HtmlTextWriter writer)
    {
        writer.WriteLine("&amp;lt;head&amp;gt;");
            
        HtmlHead headTag = (HtmlHead)this.Control;
        foreach(Control contrl in headTag.Controls)
        {
            contrl.RenderControl(writer);
        }

        writer.WriteLine("&amp;lt;/head&amp;gt;");
    }
} 
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;i&gt;HtmlTitleAdapter&lt;/i&gt; 
&lt;pre&gt;public class HtmlTitleAdapter : System.Web.UI.Adapters.ControlAdapter
{
    protected override void Render(HtmlTextWriter writer)
    {
        // Title
        writer.Write("&amp;lt;title&amp;gt;");
        writer.Write(Page.Title);
        writer.WriteLine("&amp;lt;/title&amp;gt;");
    }
}
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;i&gt;HtmlMetaAdapter&lt;/i&gt; 
&lt;pre&gt;public class HtmlMetaAdapter : System.Web.UI.Adapters.ControlAdapter
{
    protected override void Render(HtmlTextWriter writer)
    {
        HtmlMeta metaTag = (HtmlMeta)this.Control;

        writer.Write("&amp;lt;meta");

        if (!String.IsNullOrEmpty(metaTag.HttpEquiv))
        {
            writer.Write(" http-equiv=\"");
            writer.Write(metaTag.HttpEquiv);
            writer.Write("\"");
        }

        if (!String.IsNullOrEmpty(metaTag.Name))
        {
            writer.Write(" name=\"");
            writer.Write(metaTag.Name);
            writer.Write("\"");
        }

        writer.Write(" content=\"");
        writer.Write(metaTag.Content);
        writer.Write("\"");

        writer.WriteLine(" /&amp;gt;");
    }
}
&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;&lt;i&gt;HtmlLinkAdapter&lt;/i&gt; 
&lt;pre&gt;public class HtmlLinkAdapter : System.Web.UI.Adapters.ControlAdapter
{
    protected override void Render(HtmlTextWriter writer)
    {
        HtmlLink linkTag = (HtmlLink)this.Control;

        if ((linkTag.Attributes != null) &amp;amp;&amp;amp; 
            (linkTag.Attributes.Count &amp;gt; 0))
        {
            writer.Write("&amp;lt;link");

            foreach (string key in linkTag.Attributes.Keys)
            {
                writer.Write(" ");
                writer.Write(key);
                writer.Write("=\"");
                writer.Write(linkTag.Attributes[key]);
                writer.Write("\"");
            }

            writer.WriteLine(" /&amp;gt;");
        }
    }
}
&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2816.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET: Override HtmlHead Rendering with ControlAdapters</title><link>http://blogs.x2line.com/al/archive/2007/01/31/2814.aspx</link><pubDate>Wed, 31 Jan 2007 00:28:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/31/2814.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2814.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/31/2814.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2814.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2814.aspx</trackback:ping><description>&lt;p&gt;2 weeks ago or so I posted about the problematic rendering of &lt;i&gt;HtmlHead&lt;/i&gt; server control in MasterPage - &lt;a title="MasterPage HtmlHead Renders Messy HTML" href="http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx" target="_blank"&gt;MasterPage HtmlHead Renders Messy HTML&lt;/a&gt;. Design-time tags rendering is messed up not to mention additional tab characters and spaces inside the title tag... I think that all core Rendering implementation out there has problems. I also totally don't understand the need to render tab characters.&lt;/p&gt;&lt;br&gt; &lt;p&gt;Fortunately this behaviour can be overriden using control adapters. All credit goes to &lt;a title="Bazile" href="http://relib.com/blogs/bazile/" target="_blank"&gt;Bazile&lt;/a&gt; for the idea and control adapter samples - see &lt;a title="original solution" href="http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx#2812" target="_blank"&gt;original solution&lt;/a&gt; in the comments to my entry.&lt;/p&gt;&lt;br&gt; &lt;p&gt;The implementation is like so:&lt;/p&gt;&lt;br&gt; &lt;ol&gt; &lt;li&gt;Create control adapters classes (class that inherits from &lt;i&gt;System.Web.UI.Adapters.ControlAdapter&lt;/i&gt;):&lt;/li&gt;  &lt;ul&gt; &lt;li&gt;&lt;i&gt;HtmlHeadAdapter&lt;/i&gt;&lt;/li&gt;  &lt;li&gt;&lt;i&gt;HtmlLinkAdapter&lt;/i&gt;&lt;/li&gt;  &lt;li&gt;&lt;i&gt;HtmlMetaAdapter&lt;/i&gt;&lt;/li&gt;  &lt;li&gt;&lt;i&gt;HtmlTitleAdapter&lt;/i&gt; (My 2 cents - instead of rendering title inside &lt;i&gt;HtmlHeadAdapter&lt;/i&gt;)&lt;/li&gt; &lt;/ul&gt; &lt;li&gt;Override &lt;i&gt;Render&lt;/i&gt; method in each one of them.&lt;/li&gt;  &lt;li&gt;Create folder &lt;i&gt;App_Browsers&lt;/i&gt; in the root of your web application.&lt;/li&gt;  &lt;li&gt;Create a file named &lt;i&gt;Default.browser&lt;/i&gt; under &lt;i&gt;App_Browsers&lt;/i&gt;.&lt;/li&gt; &lt;/ol&gt;&lt;br&gt; &lt;p&gt;Example of &lt;i&gt;Default.browser&lt;/i&gt; implementation:&lt;/p&gt;&lt;br&gt; &lt;pre&gt;&amp;lt; browsers&amp;gt;
    &amp;lt; browser refID="Default"&amp;gt;
        &amp;lt; controlAdapters&amp;gt;
            &amp;lt; adapter
            controlType="System.Web.UI.HtmlControls.HtmlHead"
            adapterType="Onecone.Web.ControlAdapters.HtmlHeadAdapter" /&amp;gt;
            &amp;lt; adapter
            controlType="System.Web.UI.HtmlControls.HtmlTitle"
            adapterType="Onecone.Web.ControlAdapters.HtmlTitleAdapter" /&amp;gt;
            &amp;lt; adapter
            controlType="System.Web.UI.HtmlControls.HtmlLink"
            adapterType="Onecone.Web.ControlAdapters.HtmlLinkAdapter" /&amp;gt;
            &amp;lt; adapter
            controlType="System.Web.UI.HtmlControls.HtmlMeta"
            adapterType="Onecone.Web.ControlAdapters.HtmlMetaAdapter" /&amp;gt;
        &amp;lt; /controlAdapters&amp;gt;
    &amp;lt; /browser&amp;gt;
&amp;lt; /browsers&amp;gt;
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;That's it.&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2814.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET: HttpNotFoundHandler Custom Implementation</title><link>http://blogs.x2line.com/al/archive/2007/01/13/2783.aspx</link><pubDate>Sat, 13 Jan 2007 10:44:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/13/2783.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2783.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/13/2783.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2783.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2783.aspx</trackback:ping><description>&lt;p&gt;Below is a small code snippet, that implements &lt;i&gt;System.Web.HttpNotFoundHandler&lt;/i&gt; functionality. Speaking of which - &lt;i&gt;System.Web.HttpNotFoundHandler&lt;/i&gt; intercepts 404 (Page not found) request having .aspx extension. Custom implementation used instead because:&lt;/p&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;&lt;i&gt;System.Web.HttpNotFoundHandler&lt;/i&gt; is not accessible.&lt;/li&gt;  &lt;li&gt;Original ProcessRequest throws exception, while I want just to complete request with 404 status. &lt;/li&gt; &lt;/ul&gt;&lt;br&gt; &lt;p&gt;When to use and why do I need it ? Well - I find it useful when need to "remove" some page or resource, quickly put it offline, but without changing code or moving files - just add a path to web.config and associate with &lt;b&gt;HttpNotFoundHandler&lt;/b&gt;. Various scenarios come in mind...&lt;/p&gt;&lt;br&gt; &lt;pre&gt;public class HttpNotFoundHandler : System.Web.IHttpHandler
{
    public HttpNotFoundHandler() { }
    
    public void ProcessRequest(HttpContext context)
    {
        string msg404 = "404 - Page not found.";
        context.Response.Write(msg404);
        context.Response.StatusCode = 404;
        context.Response.StatusDescription = msg404;
        context.ApplicationInstance.CompleteRequest();
    }

    public bool IsReusable
    {
        get { return false; }
    }
}
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;Enjoy&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2783.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET 2.0: MasterPage HtmlHead Renders Messy HTML</title><link>http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx</link><pubDate>Wed, 10 Jan 2007 04:25:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2773.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/10/2773.aspx#Feedback</comments><slash:comments>6</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2773.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2773.aspx</trackback:ping><description>&lt;p&gt;This bug in MasterPage's &lt;b&gt;HtmlHead control&lt;/b&gt; rendering is rather annoying to say the least. If head element is specified as &lt;i&gt;runat="server"&lt;/i&gt; at design time it seems that ASP.NET renders all previously design-time defined tags as one literal control, which means - it renders all tags as one long string eating all line-breaks. Suppose the following head element in &lt;b&gt;MasterPage&lt;/b&gt; markup like so:&lt;/p&gt;&lt;br&gt; &lt;pre&gt;&amp;lt; !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 
Transitional//EN" "DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt; html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&amp;gt;
&amp;lt; head runat="server"&amp;gt;
&amp;lt; title&amp;gt;&amp;lt; /title&amp;gt;
&amp;lt; meta http-equiv="content-type" content="text/html; charset=utf-8" /&amp;gt;
&amp;lt; meta name="keywords" content="mykwords" /&amp;gt;
&amp;lt; link href="/mycss.css" type="text/css" rel="stylesheet" /&amp;gt;
&amp;lt; /head&amp;gt;
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;Now I go and set the title in the content page like so:&lt;/p&gt;&lt;br&gt;
&lt;pre&gt;this.Header.Title = "My Title";
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;Expecting to get just the same markup for my head element with title string just inside title tag. I don't expect head element to be totally reformatted !&lt;/p&gt;&lt;br&gt;
&lt;p&gt;Instead, what I get is:&lt;/p&gt;&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;All design-time tags are rendered as one long string without line-breaks.&lt;/li&gt; 
&lt;li&gt;Title tag is rendered without line-break before and after.&lt;/li&gt; 
&lt;li&gt;Title tag has 2 additional line-breaks before and after its innerHtml.&lt;/li&gt; 
&lt;li&gt;Title tag has additional tab character after the line-break before its innerHtml starts.&lt;/li&gt;
&lt;/ul&gt;&lt;br&gt;
&lt;p&gt;LOL. Somebody has to take care of this...&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2773.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET 2.0: Bug - XHTML - Javascript Rendering</title><link>http://blogs.x2line.com/al/archive/2007/01/06/2766.aspx</link><pubDate>Sat, 06 Jan 2007 06:23:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/06/2766.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2766.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/06/2766.aspx#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2766.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2766.aspx</trackback:ping><description>&lt;p&gt;Suppose the following scenario:&lt;/p&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;Default XHTML conformance (transitional).&lt;/li&gt;  &lt;li&gt;Webform with textboxes, submit button and RequiredFieldValidator fields. &lt;/li&gt;&lt;/ul&gt;&lt;br&gt; &lt;p&gt;Since submit button onsubmit attribute is rendered as follows in IE 7:&lt;/p&gt;&lt;br&gt; &lt;pre&gt;javascript:WebForm_DoPostBackWithOptions(new 
WebForm_PostBackOptions("ctl02", "", true, "", "", false, true))"
&lt;/pre&gt;&lt;br&gt;
&lt;p&gt;It causes javascript error in IE 7 (annoying small yellow js error icon at the bottom-left). Missing semi-colon [ ; ]. While everything works fine (form submits normally).&lt;/p&gt;&lt;br&gt;
&lt;p&gt;I don't get javascript error when either of the following:&lt;/p&gt;&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;Using FF.&lt;/li&gt; 
&lt;li&gt;Using &lt;i&gt;enableclientscript="false"&lt;/i&gt; attribute for RequiredFieldValidator (no javascript, validation is server-side).&lt;/li&gt; 
&lt;li&gt;Using &lt;i&gt;Legacy&lt;/i&gt; attribute for &lt;b&gt;XHTMLconformance&lt;/b&gt; in web.config. &lt;/li&gt;&lt;/ol&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2766.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>Anatoly Lubarsky</dc:creator><title>ASP.NET: Bug in IIS - .NET runtime versions compatibility</title><link>http://blogs.x2line.com/al/archive/2007/01/05/2757.aspx</link><pubDate>Fri, 05 Jan 2007 03:06:00 GMT</pubDate><guid>http://blogs.x2line.com/al/archive/2007/01/05/2757.aspx</guid><wfw:comment>http://blogs.x2line.com/al/comments/2757.aspx</wfw:comment><comments>http://blogs.x2line.com/al/archive/2007/01/05/2757.aspx#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://blogs.x2line.com/al/comments/commentRss/2757.aspx</wfw:commentRss><trackback:ping>http://blogs.x2line.com/al/services/trackbacks/2757.aspx</trackback:ping><description>&lt;p&gt;Everyone seems to be quiet on this. We have already SP1 out for both VS2003 and VS2005 but seems like that many issues are yet to be fixed...&lt;/p&gt;&lt;br&gt; &lt;p&gt;Suppose the following scenario:&lt;/p&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;Create ASP.NET application in VS2003.&lt;/li&gt; &lt;li&gt;Compile it, test.&lt;/li&gt; &lt;li&gt;Create a MSI setup in VS2003 (I'm still in the same solution).&lt;/li&gt; &lt;li&gt;So, take your MSI and deploy it to another computer.&lt;/li&gt; &lt;/ul&gt;&lt;br&gt; &lt;p&gt;The bug: When MSI is installed on that another computer - it is installed under IIS virtual derectory and the application is &lt;b&gt;configured as .NET 2.0 runtime application&lt;/b&gt; in IIS by default. You cannot know this until you browse IIS administration panel for that application.&lt;/p&gt;&lt;br&gt; &lt;p&gt;Which can cause unpredictable results, since:&lt;/p&gt;&lt;br&gt; &lt;ul&gt; &lt;li&gt;This scenario is not tested.&lt;/li&gt; &lt;li&gt;It forces rendering as &lt;b&gt;XHTML compliant&lt;/b&gt;, while VS2003's ASP.NET generated HTML is not XHTML compliant. Like it renders ClientID as ctl00_controlId if we use master page, while ASP.NET 1.1 renders it the other way.&lt;/li&gt; &lt;li&gt;Not to mention .NET 1.1 does not support &lt;b&gt;XHMLconformance&lt;/b&gt; tag in web.config.&lt;/li&gt; &lt;li&gt;The application is not performant since it was not compiled under the runtime it runs.&lt;/li&gt; &lt;li&gt;There are other incompatibilities since ASP.NET 2.0 is not fully backward compatible with ASP.NET 1.1.&lt;/li&gt;  &lt;/ul&gt;&lt;br&gt; &lt;p&gt;If you ask - there is a reason why the application is build with VS2003 and not VS2005.&lt;/p&gt;&lt;br&gt; &lt;p&gt;My advice: instead of being so enthusiastic about reporting bugs fixed in VS2005 SP 1 or reporting getting MVP awards (for answering the same questions in forums year after year ?) - start to take care of real things.&lt;/p&gt;&lt;br&gt; &lt;p&gt;P.S. And for god sake - why is it impossible in VS2005 to compile for .NET 1.1 runtime ?&lt;/p&gt;&lt;img src ="http://blogs.x2line.com/al/aggbug/2757.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>