<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.iis.net/utility/FeedStylesheets/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/" xmlns:cs="http://blogs.iis.net/"><channel><title>Sakya&amp;#39;s Blog : ASP.NET</title><link>http://blogs.iis.net/sakyad/archive/tags/ASP.NET/default.aspx</link><description>Tags: ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>ASP.NET Menu Control getting padded with white space on IE8</title><link>http://blogs.iis.net/sakyad/archive/2009/04/11/asp-net-menu-control-getting-padded-with-white-space-on-ie8.aspx</link><pubDate>Sat, 11 Apr 2009 19:29:00 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:3081142</guid><dc:creator>sakya_dasgupta</dc:creator><slash:comments>2</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sakyad/rsscomments.aspx?PostID=3081142</wfw:commentRss><comments>http://blogs.iis.net/sakyad/archive/2009/04/11/asp-net-menu-control-getting-padded-with-white-space-on-ie8.aspx#comments</comments><description>&lt;p&gt;   &lt;div class="wlWriterSmartContent" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d286e652-3988-40ee-9043-f76c6f1f11ba" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/VS%202008" rel="tag"&gt;VS 2008&lt;/a&gt;,&lt;a href="http://technorati.com/tags/IE%208" rel="tag"&gt;IE 8&lt;/a&gt;,&lt;a href="http://technorati.com/tags/CSS%202.0" rel="tag"&gt;CSS 2.0&lt;/a&gt;&lt;/div&gt; &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Recently I was helping this developer on a particularly interesting issue. He had an asp.net web application that had been in productions for years and worked perfectly. Now they were planning to use XHTML 1.1 instead of the previous XHTML 1.0 Transitional and target the most recent browsers, primarily IE 8.&lt;/p&gt;  &lt;p&gt;Interestingly when they tried to use the same code that was on production in there test environment using XHTML 1.1 and tested on IE 8, the menu controls were no longer rendering as expected; but had white space padding on top and bottom of the control. It was a pretty simple basic menu control with some CSS 2.0 styling. Furthermore the solution to this was simply changing to the IE 8 compatibility mode from the browser settings. Needless to say this is not a very acceptable solution :) :)&lt;/p&gt;  &lt;p&gt;This is when I decided to repro the issue with a just a simple menu control on a default.aspx page. And interestingly I was able to reproduce the issue very quickly; in fact even without the CSS styling we can see the issue.&amp;#160; Now we already had a known issue with the menu control rendering in IE 8 and have an available hot fix for it &amp;#8211; here&amp;#8217;s an excerpt from Bertrand Roy&amp;#8217;s blog. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/bleroy/archive/2009/03/23/asp-menu-fix-for-ie8-problem-available.aspx"&gt;http://weblogs.asp.net/bleroy/archive/2009/03/23/asp-menu-fix-for-ie8-problem-available.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#8220;&lt;em&gt;It so happens that the menu control is making a bad assumption on what the default value for z-index should be. We debated this at length with the IE team, but it became clear as we did so that they were right and that we were wrong. We had to fix that.&amp;#8221;&lt;/em&gt;     &lt;br /&gt;&lt;a href="http://support.microsoft.com/kb/962351"&gt;http://support.microsoft.com/kb/962351&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;So the first step was to apply the hot fix, however even after this we see the white space padding. The repro can be simply done using the following code: using a simple menu control, a div tag to form a border around it and use some basic CSS styling&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;lt;%@ Page Language=&amp;quot;vb&amp;quot; AutoEventWireup=&amp;quot;false&amp;quot; CodeBehind=&amp;quot;Default.aspx.vb&amp;quot; Inherits=&amp;quot;WebApplication3._Default&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; Trace=&amp;quot;false&amp;quot; %&amp;gt; &lt;/font&gt;&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;lt;!DOCTYPE html PUBLIC &amp;quot;-//W3C//DTD XHTML 1.1//EN&amp;quot; &amp;quot;&lt;/font&gt;&lt;a href="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" ?="?"&gt;&lt;font color="#800000"&gt;http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&amp;quot;&lt;/font&gt;&lt;/a&gt;&lt;font color="#800000"&gt;&amp;gt;      &lt;br /&gt;&amp;lt;html xmlns=&amp;quot;&lt;/font&gt;&lt;a href="http://www.w3.org/1999/xhtml" ?="?"&gt;&lt;font color="#800000"&gt;http://www.w3.org/1999/xhtml&amp;quot;&lt;/font&gt;&lt;/a&gt;&lt;font color="#800000"&gt;&amp;gt;      &lt;br /&gt;&amp;lt;head runat=&amp;quot;server&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;link href=&amp;quot;StyleSheet1.css&amp;quot; type=&amp;quot;text/css&amp;quot; rel=&amp;quot;stylesheet&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;title&amp;gt;&amp;lt;/title&amp;gt;&amp;#160;&amp;#160; &lt;br /&gt;&amp;lt;/head&amp;gt;       &lt;br /&gt;&amp;lt;body&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &amp;lt;form id=&amp;quot;form1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;div style=&amp;quot;border: 1px solid #FF0000;&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:MenuID=&amp;quot;Menu1&amp;quot;runat=&amp;quot;server&amp;quot;BackColor=&amp;quot;#B5C7DE&amp;quot;DynamicHorizontalOffset=2&amp;quot; Font-Names=&amp;quot;Verdana&amp;quot; Font-Size=&amp;quot;0.8em&amp;quot; ForeColor=&amp;quot;#284E98&amp;quot; Orientation=&amp;quot;Horizontal&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StaticSubMenuIndent=&amp;quot;10px&amp;quot;&amp;#160; BorderStyle=&amp;quot;None&amp;quot; BorderWidth=&amp;quot;0px&amp;quot;&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;StaticSelectedStyle BackColor=&amp;quot;#507CD1&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;StaticMenuItemStyle HorizontalPadding=&amp;quot;5px&amp;quot;VerticalPadding=&amp;quot;2px&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DynamicHoverStyle BackColor=&amp;quot;#284E98&amp;quot; ForeColor=&amp;quot;White&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#ff0000"&gt;&amp;lt;DynamicMenuStyle BackColor=&amp;quot;#B5C7DE&amp;quot; CssClass=&amp;quot;IE8Fix&amp;quot;/&amp;gt; &lt;/font&gt;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DynamicSelectedStyle BackColor=&amp;quot;#507CD1&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;DynamicMenuItemStyle HorizontalPadding=&amp;quot;5px&amp;quot; VerticalPadding=&amp;quot;2px&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;StaticHoverStyle BackColor=&amp;quot;#284E98&amp;quot; ForeColor=&amp;quot;White&amp;quot; /&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;Items&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:MenuItem ImageUrl=&amp;quot;~/Images/TM_Payments.gif&amp;quot; PopOutImageUrl=&amp;quot;~/Images/PopOutImage.gif&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SeparatorImageUrl=&amp;quot;~/Images/TM_SeparatorImage.gif&amp;quot;&amp;gt;       &lt;br /&gt;&amp;lt;asp:MenuItem Text=&amp;quot;New Item&amp;quot; Value=&amp;quot;New Item&amp;quot;&amp;gt;&amp;lt;/asp:MenuItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:MenuItem Text=&amp;quot;New Item&amp;quot; Value=&amp;quot;New Item&amp;quot;&amp;gt;&amp;lt;/asp:MenuItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:MenuItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;asp:MenuItem ImageUrl=&amp;quot;~/Images/TM_ExemptionsAndSavings.gif&amp;quot; PopOutImageUrl=&amp;quot;~/Images/PopOutImage.gif&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; SeparatorImageUrl=&amp;quot;~/Images/TM_SeparatorImage.gif&amp;quot;&amp;gt;&amp;lt;/asp:MenuItem&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/Items&amp;gt;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;lt;/asp:Menu&amp;gt; &amp;lt;/div&amp;gt; &amp;lt;/form&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&lt;/font&gt;&lt;/p&gt; &lt;font color="#800000"&gt;   &lt;p&gt;&lt;strong&gt;The CSS file used:&lt;/strong&gt; &lt;font color="#ff0000"&gt;StyleSheet1.css&lt;/font&gt; is even simpler and is being used to get around the problem of the value of the z-index being set to auto and I &amp;#8217;am basically manually providing a value to it. (This is what the hot fix is for, however I like to overly protective about my controls :) )&lt;/p&gt;  &lt;/font&gt;  &lt;p&gt;   &lt;br /&gt;&lt;font color="#800000"&gt;.IE8Fix      &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; z-index: &lt;font color="#0000ff"&gt;1000&lt;/font&gt;;       &lt;br /&gt;}&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Now here is the funny part, I would expect it to render just perfect, but we actually get a strange white space on top of the menu control. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/1_2.jpg"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="164" alt="1" src="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/1_thumb.jpg" width="319" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;And as mentioned previously just changing the to the IE7 compatibility mode from the browser , everything works fine. &lt;/p&gt;  &lt;p&gt;This is when I decided to put to use the new developer tool that ships in with the IE 8. After a lot of scratching my head, playing with the tool, comparison with IE 7 source view and a whole lot of caffeine, to my surprise I found a line of code that seemed a little strange as I did not put it in there. &lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;a href="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="268" alt="image" src="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/image_thumb.png" width="351" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;lt;a href&lt;font color="#0000ff"&gt;=&amp;quot;#Menu1_SkipLink&amp;quot;&amp;gt;&lt;/font&gt;       &lt;br /&gt;&amp;lt;img width=&amp;quot;0&amp;quot; height=&amp;quot;0&amp;quot; style=&amp;quot;border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px;&amp;quot; alt=&amp;quot;Skip Navigation Links&amp;quot; src=&amp;quot;/WebResource.axd?d=uRB0WdB6KVmD8fqrZUdC3A2&amp;amp;t=633697551594691359&amp;quot;/&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;This is line of code was present in both the view source from IE 8 and IE 7 , but strangely it was being rendered by IE 8 and not by IE 7. This skip link control is added by default for the menu control, and since on IE 8 it was being rendered it was taking the invisible white space on top of each menu control.&lt;/p&gt;  &lt;p&gt;So eureka struck :) , I simply added a SkipLinkText=&amp;quot;&amp;quot; to my code and vola!! everything renders just as expected......&lt;/p&gt;  &lt;p&gt;&lt;font color="#800000"&gt;&amp;lt;asp:Menu ID=&amp;quot;Menu1&amp;quot; runat=&amp;quot;server&amp;quot; BackColor=&amp;quot;#B5C7DE&amp;quot; DynamicHorizontalOffset=&amp;quot;2&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; Font-Names=&amp;quot;Verdana&amp;quot; Font-Size=&amp;quot;0.8em&amp;quot; ForeColor=&amp;quot;#284E98&amp;quot; Orientation=&amp;quot;Horizontal&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; StaticSubMenuIndent=&amp;quot;10px&amp;quot; CssClass=&amp;quot;mainmenu&amp;quot; BorderStyle=&amp;quot;None&amp;quot; BorderWidth=&amp;quot;0px&amp;quot;&lt;/font&gt;&lt;font color="#0000ff"&gt;SkipLinkText=&amp;quot;&amp;quot;&amp;gt;&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;Here&amp;#8217;s the perfect rendering......&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/image_6.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="197" alt="image" src="http://blogs.iis.net/blogs/sakyad/WindowsLiveWriter/ASP.NETMenuControlgettingpaddedwithwhite_B85F/image_thumb_2.png" width="363" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Still not sure why this Skiplink control is being rendered for a default menu control. However this is a simple workaround that can be used to get over this issue...........&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;( &lt;em&gt;BTW it does not matter whether you use XHTTP1.1 or XHTTP 1.0 Transitional&lt;/em&gt; ) &lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=3081142" width="1" height="1"&gt;</description><enclosure url="http://blogs.iis.net/sakyad/attachment/3081142.ashx" length="542194" type="application/x-zip-compressed" /><category domain="http://blogs.iis.net/sakyad/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://blogs.iis.net/sakyad/archive/tags/VS+2008/default.aspx">VS 2008</category><category domain="http://blogs.iis.net/sakyad/archive/tags/IE+8/default.aspx">IE 8</category><category domain="http://blogs.iis.net/sakyad/archive/tags/Menu+control/default.aspx">Menu control</category></item><item><title>Process and Thread Identity in ASP.NET – A Practical Approach</title><link>http://blogs.iis.net/sakyad/archive/2008/11/19/process-and-thread-identity-in-asp-net-a-practical-approach.aspx</link><pubDate>Thu, 20 Nov 2008 00:43:56 GMT</pubDate><guid isPermaLink="false">50bcf3b4-f6fe-4638-adff-0c150e922e99:2756525</guid><dc:creator>sakya_dasgupta</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.iis.net/sakyad/rsscomments.aspx?PostID=2756525</wfw:commentRss><comments>http://blogs.iis.net/sakyad/archive/2008/11/19/process-and-thread-identity-in-asp-net-a-practical-approach.aspx#comments</comments><description>&lt;p&gt;The following scenarios establish the way the process identity and the thread identity are defined while building asp.net websites and publishing using the IIS webserver. &lt;/p&gt;  &lt;p&gt;IIS supports the following authentication types : &lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;Anonymous&lt;/b&gt; &amp;#8211; In this case the default credentials are of the IUSR_Machinename user . &lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;Integrated Windows Authentication (IWA)&lt;/b&gt; : This can either use NTLM challenge/Response or can be configured to use Kerberos. However for this discussion we will not delve into those details. In general while using IWA IIS authenticates using the credentials of the logged on user.&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;Basic authentication&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&amp;#183; &lt;b&gt;Digest authentication&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Here we are interested in the anonymous and IWA authentication types and how it impacts ASP.NET &lt;/p&gt;  &lt;p&gt;&lt;b&gt;ASP.NET Impersonation&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Impersonation is when ASP.NET executes code in the context of an authenticated and authorized client. By default, ASP.NET does not use impersonation and instead executes all code using the same user account as the ASP.NET process, which is typically the ASPNET account. This is contrary to the default behavior of ASP, which uses impersonation by default. In Internet Information Services (IIS) 6, the default identity is the NetworkService account.&lt;/p&gt;  &lt;p&gt;Eg. &amp;lt;identity impersonate = &amp;#8220;true&amp;#8221;/&amp;gt;&lt;/p&gt;  &lt;p&gt;Using impersonation, ASP.NET applications can optionally execute the processing thread using the identity of the client on whose behalf they are operating. If you enable impersonation, ASP.NET can either impersonate the authenticated identity received from IIS or one specified in the application's Web.config file.&lt;b&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;Now we&amp;#8217;ll have a look at the scenarios inorder to get a better under standing of the process identity and the Win32 thread identity under which ASP.NET is executing.&lt;/p&gt;  &lt;p&gt;The following code is used to get the current process identity for asp.net and the win32 thread identity rideing on top of it.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;System.Security.Principal.WindowsIdentity.GetCurrent().Name.ToString()&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;System.Threading.Thread.CurrentPrincipal.Identity.Name.ToString()&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;&lt;em&gt;&lt;u&gt;Now lets take a look at the scenarios : &lt;/u&gt;&lt;/em&gt;&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 1&lt;/b&gt; : ASP.NET Website located on the local machine and IIS uses IWA . Impersonation is set as &amp;#8220;false&amp;#8221; .&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Observation&lt;/b&gt; : The process identity =NT AUTHORITY\NETWORK SERVICE and the Thread identity is the default logged on users credentials &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 2&lt;/b&gt;: ASP.NET Website located on the local machine and IIS uses IWA&lt;/p&gt;  &lt;p&gt;Impersonation is set as &amp;#8220;true&amp;#8221; .&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Observation&lt;/b&gt; : Both the Process Identity and the Thread Identity is the default logged on user credentials .&lt;/p&gt;  &lt;p&gt;Next We&amp;#8217;ll look at the way the process identity is affected if we place the website contents on a remote UNC share path. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 3&lt;/b&gt;: ASP.NET website placed on a remote share location and Impersonation is set as &amp;#8220;false&amp;#8221; and IIS uses IWA. In the connect as option check the box which says &lt;b&gt;, &lt;/b&gt;Always use the authenticated users credentials when validating access to the network directory.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Observation&lt;/b&gt; : The process Identity = NT AUTHORITY\NETWORK SERVICE.&lt;/p&gt;  &lt;p&gt;You may receive one or more error messages when you try to access an ASP.NET application that is hosted by using pass-through authentication in a UNC virtual directory in Internet Information Services 6.0 &lt;/p&gt;  &lt;p&gt;&lt;b&gt;CAUSE&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;This problem occurs because ASP.NET applications are not supported when you select the &lt;b&gt;Always use the authenticated user's credentials when validating access to the network directory&lt;/b&gt; check box in IIS 6.0. &lt;/p&gt;  &lt;p&gt;&lt;b&gt;RESOLUTION&lt;/b&gt;&lt;/p&gt;  &lt;p&gt;To resolve this issue, enter a valid user name and password on the Security Credentials page in the Virtual Directory Creation Wizard when you intend to host an ASP.NET application that is located on a UNC share.&lt;/p&gt;  &lt;p&gt;Refer KB : &lt;a href="http://support.microsoft.com/kb/897110"&gt;http://support.microsoft.com/kb/897110&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Scenario 4&lt;/b&gt; : ASP.NET website placed on a remote share location and Impersonation is set as &amp;#8220;true&amp;#8221; and IIS uses IWA. In the connect as option specify a user name and password to reach the path. &lt;/p&gt;  &lt;p&gt;Note : The username and password specified should also be there on the folder being accessed . i.e the same user should be explicity added and the password should be in sync on that folder.&lt;/p&gt;  &lt;p&gt;&lt;b&gt;Observation&lt;/b&gt; : Both the Process identity and the thread identity is that of the one used to access the UNC path .&lt;/p&gt;  &lt;p&gt;For further information visit :&lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/910449"&gt;http://support.microsoft.com/kb/910449&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://support.microsoft.com/kb/891031"&gt;http://support.microsoft.com/kb/891031&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/aa302393.aspx"&gt;http://msdn.microsoft.com/en-us/library/aa302393.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.iis.net/aggbug.aspx?PostID=2756525" width="1" height="1"&gt;</description><category domain="http://blogs.iis.net/sakyad/archive/tags/IIS+6.0/default.aspx">IIS 6.0</category><category domain="http://blogs.iis.net/sakyad/archive/tags/Process+Identity/default.aspx">Process Identity</category><category domain="http://blogs.iis.net/sakyad/archive/tags/ASP.NET+Impersonation/default.aspx">ASP.NET Impersonation</category><category domain="http://blogs.iis.net/sakyad/archive/tags/ASP.NET/default.aspx">ASP.NET</category></item></channel></rss>