Wednesday, April 23rd, 2008
This is a simple little random fact generator which will show a new fact every time the page loads. After the initial load it will store the XML in the cache until the file is changed again.
XML: (Facts.xml)
<?xml version=”1.0″ encoding=”utf-8″ ?>
<facts>
<fact>
The numbers ‘172′ can be found on the back […]
Programming |
Tuesday, April 22nd, 2008
Based on the reader comments on my previous entry on this topic I was able to fix some of the issues that others were experiencing.
I changed how the output is read, instead of reading the entire stream at once, its now read line-by-line as ErrorDataReceived and OutputDataReceived events are raised. Also added an extra option […]
Programming |
Friday, April 18th, 2008
Recently I was involved in a project where I had to make heavy use of AJAX. I realized there are a few simple things you could do to improve performance.
1) Combine scripts
<ajaxToolkit:ToolkitScriptManager ID=”TSM1” runat=”Server”
EnablePartialRendering=”true”
CombineScriptsHandlerUrl=”~/CombineScriptsHandler.ashx” />
As the name of the property suggests, it will pretty much combine all the needed JS files into one which in […]
Programming |
Tuesday, April 8th, 2008
In my previous post about exception logging, I show how to log several different parameters related to the exception in the database. Request.Browser.Crawler is one of them and its used to track browser crawlers. It warrants its own separate entry since it requires some extra bit of setup in the web.config to get it to […]
Programming |
Tuesday, April 8th, 2008
This is a simple technique I use to log exceptions in all my web applications.
First lets start by adding the following to the web.config:
<appSettings>
<add key=”LogUnhandledExceptions” value=”true”/>
</appSettings>
Second, we add the following bit inside the Application_Error event of the Global.asax file. This will capture all the unhandled exceptions and log them into the database:
private static bool logUnhandledExceptions […]
Programming |