<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" 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:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Channel 9 Forums - Tech Off - Web.config error pages</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Forums/rss"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Channel 9 Forums - Tech Off - Web.config error pages</title>
		<link>http://channel9.msdn.com/Forums</link>
	</image>
	<description>Channel 9 keeps you up to date with the latest news and behind the scenes info from Microsoft that developers love to keep up with. From LINQ to SilverLight – Watch videos and hear about all the cool technologies coming and the people behind them.</description>
	<link>http://channel9.msdn.com/Forums</link>
	<language>en</language>
	<pubDate>Fri, 24 May 2013 13:03:45 GMT</pubDate>
	<lastBuildDate>Fri, 24 May 2013 13:03:45 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<c9:totalResults>11</c9:totalResults>
	<c9:pageCount>-11</c9:pageCount>
	<c9:pageSize>-1</c9:pageSize>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p>If I create a custom error page in my web.config file, how do I retrieve error details in the error page?</p>
<p>&nbsp;</p>
<p>So with ...</p>
<p>&nbsp;</p>
<p>&lt;customErrors mode=&quot;On&quot; defaultRedirect=&quot;/error/error.aspx&quot;&gt;<br>
&nbsp; &lt;error statusCode=&quot;404&quot; redirect=&quot;/error/404.aspx&quot; /&gt;<br>
&lt;/customErrors&gt;</p>
<p>&nbsp;</p>
<p>How can I retrieve an instance of the exception or exception details in my &quot;/error/error.aspx&quot; page? Currently in my error page if I query Server.GetLastError() the return value is null.</p>
<p>&nbsp;</p>
<p>Curious.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/543813#543813</link>
		<pubDate>Tue, 13 Apr 2010 19:32:09 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/543813#543813</guid>
		<dc:creator>sysrpl</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/sysrpl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p>Are these ASP.NET CustomErrors or IIS Server Errors?</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ecbb69a5df284d6cb3859deb000d64a2#ecbb69a5df284d6cb3859deb000d64a2</link>
		<pubDate>Tue, 13 Apr 2010 19:42:45 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ecbb69a5df284d6cb3859deb000d64a2#ecbb69a5df284d6cb3859deb000d64a2</guid>
		<dc:creator>W3bbo</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/W3bbo/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">W3bbo said:</div><div class="quoteText">
<p>Are these ASP.NET CustomErrors or IIS Server Errors?</p>
</div></blockquote>
<p>These are asp.net errors. I created a sample page and 'throw new Exception(&quot;some error&quot;)' as a test.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/d44cf67ef6d14ae687439deb000d64ce#d44cf67ef6d14ae687439deb000d64ce</link>
		<pubDate>Tue, 13 Apr 2010 19:53:11 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/d44cf67ef6d14ae687439deb000d64ce#d44cf67ef6d14ae687439deb000d64ce</guid>
		<dc:creator>sysrpl</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/sysrpl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p>if you are looking to get the error info logged somewhere then you can use the web.config option to send errors to the windows event log.</p>
<p>&nbsp;</p>
<p>in my apps the error page is just a &quot;Sorry, if this keeps happening contact the admin&quot;</p>
<p>&nbsp;</p>
<p>and the stack trace etc... are in the event log.</p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/e0a5dab4bed2483db0919deb000d64f9#e0a5dab4bed2483db0919deb000d64f9</link>
		<pubDate>Wed, 14 Apr 2010 13:10:56 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/e0a5dab4bed2483db0919deb000d64f9#e0a5dab4bed2483db0919deb000d64f9</guid>
		<dc:creator>figuerres</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/figuerres/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">figuerres said:</div><div class="quoteText">
<p>if you are looking to get the error info logged somewhere then you can use the web.config option to send errors to the windows event log.</p>
<p>&nbsp;</p>
<p>in my apps the error page is just a &quot;Sorry, if this keeps happening contact the admin&quot;</p>
<p>&nbsp;</p>
<p>and the stack trace etc... are in the event log.</p>
</div></blockquote>
<p>Actually I was trying to create a universal &quot;catch all&quot; error screen with detailed information, but formatted in a way/styling of my own design. Thanks for the replies. I'll keep looking around for how to get this done.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/4eb5256e8cdf48ab90569deb000d6525#4eb5256e8cdf48ab90569deb000d6525</link>
		<pubDate>Wed, 14 Apr 2010 14:36:33 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/4eb5256e8cdf48ab90569deb000d6525#4eb5256e8cdf48ab90569deb000d6525</guid>
		<dc:creator>sysrpl</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/sysrpl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">sysrpl said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">figuerres said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Actually I was trying to create a universal &quot;catch all&quot; error screen with detailed information, but formatted in a way/styling of my own design. Thanks for the replies. I'll keep looking around for how to get this done.</p>
</div></blockquote>
<p>do you really want your visitors to know about your null/object not found&nbsp;exceptions or is this for debugging?</p>
<p>&nbsp;</p>
<p>in my humble opinion i think it's better to log those exceptions and direct to a *fairly* generic error page, meaning you could catch/redirect to a certain generic error page based on the context the error was created in. then you could email the exception
 to dev from the log or database if you choose to store it there (i prefer this method because i can also get additional details about the session/context, not necessarily included in the stack trace and report off of it to detect patterns).</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ebc8ff3e12b64334855e9deb000d6552#ebc8ff3e12b64334855e9deb000d6552</link>
		<pubDate>Wed, 14 Apr 2010 15:06:37 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ebc8ff3e12b64334855e9deb000d6552#ebc8ff3e12b64334855e9deb000d6552</guid>
		<dc:creator>itsnotabug</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/itsnotabug/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">itsnotabug said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">sysrpl said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>do you really want your visitors to know about your null/object not found&nbsp;exceptions or is this for debugging?</p>
<p>&nbsp;</p>
<p>in my humble opinion i think it's better to log those exceptions and direct to a *fairly* generic error page, meaning you could catch/redirect to a certain generic error page based on the context the error was created in. then you could email the exception
 to dev from the log or database if you choose to store it there (i prefer this method because i can also get additional details about the session/context, not necessarily included in the stack trace and report off of it to detect patterns).</p>
</div></blockquote>
<p>Sigh <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif' alt='Sad' /></p>
<p>&nbsp;</p>
<p>It's not a matter of what the end result will be, but what is possible and how. Of course later I may not want detailed information presented to visitors, but for now I'd just like to know how it can be done.
</p>
<p>&nbsp;</p>
<p>So back to my original question, how do I retrieve error details in the error page?</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ca51f118c0984c8a91469deb000d657f#ca51f118c0984c8a91469deb000d657f</link>
		<pubDate>Wed, 14 Apr 2010 15:17:47 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/ca51f118c0984c8a91469deb000d657f#ca51f118c0984c8a91469deb000d657f</guid>
		<dc:creator>sysrpl</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/sysrpl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">sysrpl said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">itsnotabug said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Sigh <img src="http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-6.gif" alt="Sad"></p>
<p>&nbsp;</p>
<p>It's not a matter of what the end result will be, but what is possible and how. Of course later I may not want detailed information presented to visitors, but for now I'd just like to know how it can be done.
</p>
<p>&nbsp;</p>
<p>So back to my original question, how do I retrieve error details in the error page?</p>
<p>&nbsp;</p>
</div></blockquote>
<p>Well, this is http after all and that means it is stateless. There's no magic way for the error page to figure out what exception occured during another http request unless you store that exception somewhere.</p>
<p>&nbsp;</p>
<p>You could store it in a static field (say static Exception LastError) but it won't work reliable if 2 exceptions occur at roughly the same time.</p>
<p>Or you could store it in the Session object but that doesn't sound like a good use of session state.</p>
<p>&nbsp;</p>
<p>Maybe you're just trying too hard.</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/da3c40f492a744c2bcde9deb000d65ae#da3c40f492a744c2bcde9deb000d65ae</link>
		<pubDate>Wed, 14 Apr 2010 15:38:59 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/da3c40f492a744c2bcde9deb000d65ae#da3c40f492a744c2bcde9deb000d65ae</guid>
		<dc:creator>Dexter</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Dexter/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">Dexter said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">sysrpl said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Well, this is http after all and that means it is stateless. There's no magic way for the error page to figure out what exception occured during another http request unless you store that exception somewhere.</p>
<p>&nbsp;</p>
<p>You could store it in a static field (say static Exception LastError) but it won't work reliable if 2 exceptions occur at roughly the same time.</p>
<p>Or you could store it in the Session object but that doesn't sound like a good use of session state.</p>
<p>&nbsp;</p>
<p>Maybe you're just trying too hard.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>Okay, so it's probably not there. No problem. I just thought maybe the actual error was somehow passed to the page designated to handle errors.</p>
<p>&nbsp;</p>
<p>I guess i can define a base page class to handle all errors a certain way.</p>
<p>&nbsp;</p>
<p>Thanks.</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/046131a269be49849de59deb000d65dc#046131a269be49849de59deb000d65dc</link>
		<pubDate>Wed, 14 Apr 2010 15:45:35 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/046131a269be49849de59deb000d65dc#046131a269be49849de59deb000d65dc</guid>
		<dc:creator>sysrpl</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/sysrpl/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">sysrpl said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Dexter said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Okay, so it's probably not there. No problem. I just thought maybe the actual error was somehow passed to the page designated to handle errors.</p>
<p>&nbsp;</p>
<p>I guess i can define a base page class to handle all errors a certain way.</p>
<p>&nbsp;</p>
<p>Thanks.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>If you want to have common error handling for all pages, use the Application_Error handler in Global.asax.</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/39b0671e07e248fc8ea39deb000d6609#39b0671e07e248fc8ea39deb000d6609</link>
		<pubDate>Wed, 14 Apr 2010 16:25:13 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/39b0671e07e248fc8ea39deb000d6609#39b0671e07e248fc8ea39deb000d6609</guid>
		<dc:creator>Sven Groot</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/Sven Groot/Discussions/RSS</wfw:commentRss>
	</item>
	<item>
		<title>Tech Off - Web.config error pages</title>
		<description><![CDATA[<p><blockquote><div class="quoteUser">sysrpl said:</div><div class="quoteText">
<blockquote>
<div class="quoteUser">Dexter said:</div>
<div class="quoteText">*snip*</div>
</blockquote>
<p>Okay, so it's probably not there. No problem. I just thought maybe the actual error was somehow passed to the page designated to handle errors.</p>
<p>&nbsp;</p>
<p>I guess i can define a base page class to handle all errors a certain way.</p>
<p>&nbsp;</p>
<p>Thanks.</p>
<p>&nbsp;</p>
</div></blockquote>
<p>I thought that transfers to the error pages were done with Server.Transfer so Server.GetLastError() would still be valid in the error page.</p>
<p>&nbsp;</p>
<p>Also worth a read.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/aa479319.aspx">http://msdn.microsoft.com/en-us/library/aa479319.aspx</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p></p>]]></description>
		<link>http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/7bb95c581c8e468ca2ae9deb000d6636#7bb95c581c8e468ca2ae9deb000d6636</link>
		<pubDate>Wed, 14 Apr 2010 17:50:28 GMT</pubDate>
		<guid isPermaLink="false">http://channel9.msdn.com/Forums/TechOff/543813-Webconfig-error-pages/7bb95c581c8e468ca2ae9deb000d6636#7bb95c581c8e468ca2ae9deb000d6636</guid>
		<dc:creator>PerfectPhase</dc:creator>
		<slash:comments>11</slash:comments>
		<wfw:commentRss>http://channel9.msdn.com/Niners/PerfectPhase/Discussions/RSS</wfw:commentRss>
	</item>
</channel>
</rss>