<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-8947098357699019748</id><updated>2012-02-16T07:38:47.232-08:00</updated><category term='C#'/><category term='jquery'/><category term='Microsoft'/><category term='Power Shell'/><category term='javascript'/><category term='sql server stored procedures'/><category term='ajax'/><category term='Explorer'/><category term='html'/><category term='updatepanel'/><category term='localization'/><category term='script'/><category term='SharePoint'/><category term='httpcombiner'/><category term='.net'/><category term='performance'/><category term='DateFormat'/><category term='Events'/><category term='server controls'/><category term='html div style'/><category term='ASP.NET'/><category term='.NET 2'/><category term='Transactions'/><title type='text'>Khurram Shehzad</title><subtitle type='html'>if(!IsPostBack)</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>18</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-9001100290753231421</id><published>2011-01-11T06:56:00.000-08:00</published><updated>2011-01-11T07:04:01.741-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='SharePoint'/><category scheme='http://www.blogger.com/atom/ns#' term='Power Shell'/><title type='text'>Enable-SPFeature command throwing exception</title><content type='html'>I wanted to enable a feature which required special admin rights through power-shell and kept on getting the following exception:&lt;br /&gt;&lt;br /&gt;Enable-SPFeature : Failed to create receiver object from assembly "ASSEMBLYNAME, Version=1.0.0.0, Culture=neutral, PublicKeyToken=eaf1b7820cf1&lt;br /&gt;fb30", class "CLASSNAME" for feature "FEATURENAME" (ID: 08284496-c68e-4f6c-befe-5777d14ad74b).&lt;br /&gt;: System.ArgumentNullException: Value cannot be null.&lt;br /&gt;&lt;br /&gt;Spent hours trying to find the reason. The class was there. I even gaced manually, tried everything. But later a colleague of mine helped me out with suggesting to open a new instance of power shell and try it again. And it worked perfectly. What a time waste.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-9001100290753231421?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/9001100290753231421/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=9001100290753231421' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/9001100290753231421'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/9001100290753231421'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2011/01/enable-spfeature-command-throwing.html' title='Enable-SPFeature command throwing exception'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-8176851254883073661</id><published>2009-06-03T06:44:00.000-07:00</published><updated>2009-06-03T06:45:54.061-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='sql server stored procedures'/><title type='text'>Optional parameters in SQL server</title><content type='html'>There might be situations where you would like to pass optional parameters to a stored procedure. Instead of constructing dynamic queries or doing many if else there is a cleaner way to do it.&lt;br /&gt;&lt;br /&gt;SELECT [ClubId] &lt;br /&gt; FROM [Club] where &lt;br /&gt;(@ClubId IS NULL OR ClubId = @ClubId) &lt;br /&gt;&lt;br /&gt;The where clause checks each parameter to see if it is NULL and in case it is checks the fields value with that of the parameter.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-8176851254883073661?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/8176851254883073661/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=8176851254883073661' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/8176851254883073661'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/8176851254883073661'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2009/06/optional-parameters-in-sql-server.html' title='Optional parameters in SQL server'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-9097620471823575027</id><published>2009-05-29T08:40:00.000-07:00</published><updated>2011-01-11T07:43:22.297-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='html div style'/><title type='text'>Manipulating div display in javascript and c#</title><content type='html'>To hide or show a div using javascript:&lt;br /&gt;myDiv.style.display = "none";&lt;br /&gt;myDiv.style.display = "block";&lt;br /&gt;&lt;br /&gt;in C#:&lt;br /&gt; myDiv.Attributes["style"] = "display:none;";&lt;br /&gt; myDiv.Attributes["style"] = "display:block;";&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-9097620471823575027?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/9097620471823575027/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=9097620471823575027' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/9097620471823575027'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/9097620471823575027'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2009/05/manipulating-div-in-javascript-and-c.html' title='Manipulating div display in javascript and c#'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-1015957935269422860</id><published>2009-02-24T13:09:00.000-08:00</published><updated>2009-02-26T12:53:53.365-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='updatepanel'/><title type='text'>Scroll to top on partial postback</title><content type='html'>In one of a project that I worked on we had a datalist with paging(datapager). The datalist was in an update panel to give the ajax impact and to improve the performance. The issue was when you scroll down to the page and move to the next page the page doesnt scroll up after partial postback.&lt;br /&gt;&lt;br /&gt;It can be done by adding the following code in code-behind file in page load for example.&lt;br /&gt;&lt;br /&gt;if (System.Web.UI.ScriptManager.GetCurrent(this.Page).IsInAsyncPostBack)&lt;br /&gt;System.Web.UI.ScriptManager.RegisterStartupScript(this, typeof(MyPage), "pagingAnchor", "window.location.href = '#';", true);&lt;br /&gt;&lt;br /&gt;Where MyPage is the name of your page or control.&lt;br /&gt;&lt;br /&gt;This javascript code needs to be added in the page to cancel the default scroll behavior.&lt;br /&gt;&lt;br /&gt;var prm = Sys.WebForms.PageRequestManager.getInstance();&lt;br /&gt;prm.add_beginRequest(beginRequest);&lt;br /&gt;function beginRequest()&lt;br /&gt;{&lt;br /&gt;    prm._scrollPosition = null;&lt;br /&gt;}&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-1015957935269422860?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/1015957935269422860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=1015957935269422860' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1015957935269422860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1015957935269422860'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2009/02/scroll-to-top-on-partial-postback.html' title='Scroll to top on partial postback'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-4013466672971276165</id><published>2008-12-23T13:19:00.000-08:00</published><updated>2008-12-23T13:26:07.596-08:00</updated><title type='text'>ASP.NET charts</title><content type='html'>Microsoft has recently released a much-awaited control for charts. It seems to have a considerable number of options and functionalities. The good thing is that its free so we won't necessarily need to buy expensive frameworks like Dundas etc. for basic charts.&lt;br /&gt;I really look forward to explore how it will support ajax.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx"&gt;Scott's blog&lt;/a&gt;&lt;br /&gt;Download&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=130f7986-bf49-4fe5-9ca8-910ae6ea442c&amp;DisplayLang=en"&gt; here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-4013466672971276165?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/4013466672971276165/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=4013466672971276165' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4013466672971276165'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4013466672971276165'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/12/aspnet-charts.html' title='ASP.NET charts'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-4364165594402402205</id><published>2008-12-08T21:41:00.000-08:00</published><updated>2008-12-08T21:49:12.424-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='performance'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='httpcombiner'/><title type='text'>Performance optimization on client side for ASP.NET applications</title><content type='html'>With the advent of new web applications with rich user interfaces there is lot of processing on the client side. Most of this processing is done using scripting languages like javascript. Lot of new frameworks are in the market ranging from the ones doing simple manipulation of DOM to the most complex of templates for data and charts. Not only web 2.0 applications like facebook, myspace are using this technology but line of business applications are also moving towards this model. Ajax technology provides users with a whole new user experience which is very close to desktop applications. &lt;br /&gt;&lt;br /&gt;New browsers are concentrating on this model as well with the introduction of new javascript engines. Chrome’s interface is done in a way that gives the impression of a stand-alone application running on top of desktop instead of an application opened in a browser.&lt;br /&gt;&lt;br /&gt;This new model has given rise to many challenges in terms of performance of web applications. These client side frameworks and other resources like javascripts files, stylesheets, images etc. are downloaded on the browser and if not managed properly can really affect the performance of an application. &lt;br /&gt;&lt;br /&gt;Following is a list of things to consider for improving performance an application. &lt;br /&gt;This article is more oriented towards how to improve performance of ASP.NET Ajax applications on client side.&lt;br /&gt;&lt;br /&gt;• Make fewer HTTP requests&lt;br /&gt;o Combine files&lt;br /&gt;o Use CSS sprites and image maps&lt;br /&gt;• Reduce file size&lt;br /&gt;o Minify files&lt;br /&gt;o Compress your files&lt;br /&gt;• Add expiration headers&lt;br /&gt;• Put CSS files on top and JS files on bottom&lt;br /&gt;&lt;br /&gt;An exhaustive list of these best practices can be found on yahoo’s developer website.&lt;br /&gt;http://developer.yahoo.com/performance/rules.html&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Make fewer HTTP requests&lt;br /&gt;&lt;br /&gt;With rich user interface sites, lot of files are downloaded on the client side. These files include javascripts files, stylsheets, images, flash, pages etc. HTTP protocol does a separate request for each file downloaded on the client side which can really slow down the loading of a page depending on number of files and network latency. &lt;br /&gt;&lt;br /&gt;Frameworks like jquery and its plug-ins, ajax toolkit, telerik etc. add their own resources as well. So reducing the number of these files is very important and can radically change the performance of an application. &lt;br /&gt;&lt;br /&gt;Following are few techniques to reduce the number of HTTP requests.&lt;br /&gt;a. Combine files&lt;br /&gt;i. Custom files&lt;br /&gt;For custom javascript files or stylsheets there could be multiple ways to combine them. For example:&lt;br /&gt;• Have a script/program which automatically takes resources and combines them into one or more file during deployment.&lt;br /&gt;• Reduce the number of files and merge them into a single file manually. Normally we create more files for modular purposes so this is not really a best practice to.&lt;br /&gt;• Combine files at run-time and put them in a cache. It could be done by using http handlers. For example you can dynamically create separate files for all javascripts and stylesheets and add them in application cache which would be used for subsequent requests. &lt;br /&gt;Following is an ASP.NET handler used for this purpose. You can use it as a base code and then add/modify code to match your needs. &lt;br /&gt;http://code.msdn.microsoft.com/HttpCombiner&lt;br /&gt;&lt;br /&gt;There are few important points to consider using these methods. &lt;br /&gt;o The url’s of images etc. in css files should be relative to root directory otherwise the links will be broken in the combined file.&lt;br /&gt;o If you are using ASP.NET themes to handle skinning even if you combine your files the framework will still add all the css files under theme directory in the header of every page. To avoid this you can manually delete css files added by the framework and replace them with the combined file.&lt;br /&gt;o For javascript files you can also use composite script feature of .NET 3.5 SP1. There is however a limitation in it that you cannot use more than certain number of files. A stop-gap solution is to use multiple scriptmanagerproxy controls with composite controls but this way you will have multiple combined files downloaded on the client side instead of one.&lt;br /&gt;&amp;lt;asp:ScriptManager ID=&amp;quot;ScriptManager1&amp;quot; runat=&amp;quot;server&amp;quot; &amp;gt;&lt;br /&gt;               &amp;lt;CompositeScript ScriptMode=&amp;quot;Release&amp;quot;&amp;gt;&lt;br /&gt;                   &amp;lt;Scripts&amp;gt;&lt;br /&gt;&amp;lt;asp:ScriptReference name=&amp;quot;&amp;quot; assembly=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;&amp;lt;asp:ScriptReference Path=&amp;quot;~/js/Validations.js&amp;quot; /&amp;gt;&lt;br /&gt;                  &amp;lt;/Scripts&amp;gt;&lt;br /&gt;               &amp;lt;/CompositeScript&amp;gt;&lt;br /&gt;&amp;lt;/asp:ScriptManager&amp;gt;&lt;br /&gt;ii. Framework files&lt;br /&gt;Frameworks like Telerik, ajax toolkit etc. have their own embedded resources which are downloaded on the client side. To disable it and rather use the combine files these frameworks do let you configure the default behaviour. For example for telerik you can disable the embedded resources on control or application level and then combine them either by using CompositeScript of script manager or another method discussed above.&lt;br /&gt;b. Css sprites and Image maps&lt;br /&gt;To further reduce the number of files downloaded on the client instead of having multiple image files they can be combined in one file and then with css background-image and background-position properties a segment of this file can be used to display a particular image. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2. Reduce file size&lt;br /&gt;a. Minify files&lt;br /&gt;To reduce the file size one important thing to do is remove comments, spaces, line breaks etc. from files sent to client. There exists number of solutions to minify files like JSMin, yahoo etc. In codeplex there is an open source .NET project which uses yahoo YUI compressor to minify files. &lt;br /&gt;http://www.codeplex.com/YUICompressor&lt;br /&gt;&lt;br /&gt;In case files are combined using a handler in the same handler you can call this library to minify the combined file. &lt;br /&gt;b. Compress files&lt;br /&gt;Compression can be done either on the code or IIS level. Files combined using http hanlder can be compressed in the code and enabled or disabled based on certain criteria’s like browser support etc.&lt;br /&gt;&lt;br /&gt;To enable compression on IIS follow these guidelines.&lt;br /&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5bce429d-c4a7-4f9e-a619-5972497b932a.mspx?mfr=true&lt;br /&gt;&lt;br /&gt;http://www.dotnetjunkies.com/Article/16267D49-4C6E-4063-AB12-853761D31E66.dcik&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;3. Put CSS files on top and JS files on bottom&lt;br /&gt;To reduce the delay between the time a user requests a page and something is displayed the best practice is to add css files in the header on the top and js files at the bottom. This way page would start displaying as soon as the css files are downloaded on the client side and won’t wait for the javascript files which could be loaded in the end once the page is fully loaded and client could interact with it. This avoids a white screen while the page is loaded and user can even view the contents before.&lt;br /&gt;&lt;br /&gt;ScriptManager also has a parameter LoadScriptsBeforeUI which can be used for this purpose. &lt;br /&gt;&lt;br /&gt;4. Add expiration headers&lt;br /&gt;Another important thing to configure is activating browser cache for resources like images, javascript, stylesheets etc. For static components you can configure never expire as well. Adding these headers will not download cached files if they are already fetched on the client side this saving the number of requests. &lt;br /&gt;http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/0fc16fe7-be45-4033-a5aa-d7fda3c993ff.mspx?mfr=true&lt;br /&gt;&lt;br /&gt;ASP.NET also provides certain techniques to configure cache for controls and pages.&lt;br /&gt;http://msdn.microsoft.com/en-us/library/hdxfb6cy(VS.71).aspx&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Number of tools exists to measure the performance of your pages on client side.&lt;br /&gt;&lt;br /&gt;o YSlow plug-in for firefox&lt;br /&gt;o Developer toolbar for Internet explorer&lt;br /&gt;o Fiddler&lt;br /&gt; &lt;br /&gt;YSlow provides an in depth view to improve performance along with guidelines as how to improve. &lt;br /&gt;&lt;br /&gt;Following are the few tests done on a site before and after performance settings.&lt;br /&gt;&lt;br /&gt;Before performance settings&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_0UtGFHzKP7E/ST4GTWnI-6I/AAAAAAAAAAU/zpr4U5FKow4/s1600-h/clip_image003.jpeg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 246px; height: 320px;" src="http://2.bp.blogspot.com/_0UtGFHzKP7E/ST4GTWnI-6I/AAAAAAAAAAU/zpr4U5FKow4/s320/clip_image003.jpeg" border="0" alt=""id="BLOGGER_PHOTO_ID_5277662742881827746" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;After first iteration of performance settings&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_0UtGFHzKP7E/ST4GDDeZPAI/AAAAAAAAAAM/vjII_YOkPXk/s1600-h/clip_image002.jpg"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 246px; height: 320px;" src="http://2.bp.blogspot.com/_0UtGFHzKP7E/ST4GDDeZPAI/AAAAAAAAAAM/vjII_YOkPXk/s320/clip_image002.jpg" border="0" alt=""id="BLOGGER_PHOTO_ID_5277662462866963458" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;The difference is huge in terms of number of files as well as the overall size of the page. By properly activating the cache the number of files fetched from the server is even further reduced.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-4364165594402402205?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/4364165594402402205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=4364165594402402205' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4364165594402402205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4364165594402402205'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/12/performance-optimization-on-client-side.html' title='Performance optimization on client side for ASP.NET applications'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_0UtGFHzKP7E/ST4GTWnI-6I/AAAAAAAAAAU/zpr4U5FKow4/s72-c/clip_image003.jpeg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-4598280115143975608</id><published>2008-11-13T06:42:00.000-08:00</published><updated>2008-11-13T06:44:48.965-08:00</updated><title type='text'>Google's SEO Starter Guide</title><content type='html'>Google has released a document containing best practices regarding SEO (Search Engine Optimization).&lt;br /&gt;Download &lt;a href="http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf"&gt;here.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-4598280115143975608?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://googlewebmastercentral.blogspot.com/2008/11/googles-seo-starter-guide.html' title='Google&apos;s SEO Starter Guide'/><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/4598280115143975608/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=4598280115143975608' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4598280115143975608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4598280115143975608'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/11/googles-seo-starter-guide.html' title='Google&apos;s SEO Starter Guide'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-1728266061625768766</id><published>2008-09-30T13:31:00.000-07:00</published><updated>2008-10-01T12:04:17.889-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='jquery'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><title type='text'>Asp.net embraces jquery</title><content type='html'>Great news for ajax development using JQuery. Microsoft has taken a great step announcing that jquery would be intergated in the new version of Asp.net with intellisense etc. More on &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx"&gt;Scott's blog.&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-1728266061625768766?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx' title='Asp.net embraces jquery'/><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/1728266061625768766/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=1728266061625768766' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1728266061625768766'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1728266061625768766'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/09/aspnet-embaraces-jquery.html' title='Asp.net embraces jquery'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-1097450387009569935</id><published>2008-09-29T13:15:00.000-07:00</published><updated>2008-12-08T14:01:30.349-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='javascript'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='html'/><title type='text'>Hide or change an image if not found on client side</title><content type='html'>We had a case in a project where images were loaded from external sources and we wanted to hide or change the image on client side with javascipt in case the image is not found or there was an error loading it.&lt;br /&gt;&lt;br /&gt;It can be easily done using the "onerror" event with image tag.&lt;br /&gt;For example:&lt;br /&gt;&lt;br /&gt;&amp;lt;asp:image id=&amp;quot;imgImgMap&amp;quot; onerror=&amp;quot;hideImage(this)&amp;quot; runat=&amp;quot;server&amp;quot; cssclass=&amp;quot;destMapImg&amp;quot;&amp;gt; &lt;br /&gt;&lt;br /&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;&lt;br /&gt;   function hideImage() {&lt;br /&gt;       //Load another image etc. &lt;br /&gt;    }&lt;br /&gt;&amp;lt;/script&amp;gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-1097450387009569935?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/1097450387009569935/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=1097450387009569935' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1097450387009569935'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1097450387009569935'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/09/hide-or-change-image-if-not-found-on.html' title='Hide or change an image if not found on client side'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-1603358754304974449</id><published>2008-09-16T16:18:00.000-07:00</published><updated>2008-09-16T19:19:13.459-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='server controls'/><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Default value for a dropdown list</title><content type='html'>Its a small add-in in Asp.net 2 and later but I find it very useful. If you have a dropdown list which you bind with data from a database or other source and want to add a default item as well like "Please select an item", it could be easily done with a new property AppendDataBoundItems property of dropdownlist. Simply set it to true while declaring the list and add you default item in it.&lt;br /&gt;&lt;br /&gt;When you will this list with a data source the first item would still be there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-1603358754304974449?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/1603358754304974449/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=1603358754304974449' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1603358754304974449'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/1603358754304974449'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/09/default-value-for-dropdown-list.html' title='Default value for a dropdown list'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-3888516131342312029</id><published>2008-07-10T13:25:00.000-07:00</published><updated>2008-07-10T13:32:22.333-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='DateFormat'/><category scheme='http://www.blogger.com/atom/ns#' term='.net'/><category scheme='http://www.blogger.com/atom/ns#' term='localization'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Fix Dateformat independent of culture</title><content type='html'>In a project we had a requirement of using the same date format for all cultures. This can be easily centralised in InitializeCulture() event using DateTimeFormat property of CultureInfo. We did it in a base class which is being inherited by all web pages.&lt;br /&gt;&lt;br /&gt;example.&lt;br /&gt;CultureInfo cInf = new CultureInfo(cultureName);&lt;br /&gt;cInf.DateTimeFormat.ShortDatePattern ="dd/MM/yyyy";&lt;br /&gt;            cInf.DateTimeFormat.DateSeparator = "/";&lt;br /&gt;            System.Threading.Thread.CurrentThread.CurrentCulture = cInf;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-3888516131342312029?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/3888516131342312029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=3888516131342312029' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/3888516131342312029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/3888516131342312029'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/07/fix-dateformat-independent-of-culture.html' title='Fix Dateformat independent of culture'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-7834389384328724246</id><published>2008-07-10T13:18:00.001-07:00</published><updated>2008-07-10T13:33:25.729-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='script'/><title type='text'>Register ClientScript</title><content type='html'>When javascript needs to be registered dynamically based on certain conditions we use page methods like Page.ClientScript.RegisterClientScriptBlock etc. &lt;br /&gt;In case we have an update panel and we need to register a script on partial postback it should be done through script manager. So the code would be.&lt;br /&gt;&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(Control, Type, String, String, Boolean)&lt;br /&gt;i.e.&lt;br /&gt;ScriptManager.RegisterClientScriptBlock(control, Type, key, script, add script tags or not);&lt;br /&gt;&lt;br /&gt;&lt;a href="http://fredrik.nsquared2.com/ViewPost.aspx?PostId=430"&gt;A useful blog&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-7834389384328724246?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/7834389384328724246/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=7834389384328724246' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/7834389384328724246'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/7834389384328724246'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/07/register-clientscript.html' title='Register ClientScript'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-8495830432259222392</id><published>2008-06-23T13:49:00.000-07:00</published><updated>2008-06-23T13:58:36.424-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Explorer'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Internet Explorer 8.0 Beta release</title><content type='html'>IE 8 Beta is out with new features like activities and web slices. Apparently developer tools are integrated in the new explorer. There is a also a way to emulate IE7 with IE8 which was something really missing in IE 7. &lt;br /&gt;&lt;br /&gt;I think IE 7.0 was already a step forward by Miscrosoft making it much more stable. Lets hope that the new version will be even better. &lt;br /&gt;&lt;br /&gt;Web slices is surely a feature that I would be looking forward to test.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.microsoft.com/windows/products/winfamily/ie/ie8/default.mspx"&gt;Site Link&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-8495830432259222392?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/8495830432259222392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=8495830432259222392' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/8495830432259222392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/8495830432259222392'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/06/internet-explorer-80-beta-release.html' title='Internet Explorer 8.0 Beta release'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-508836552425072368</id><published>2008-06-20T08:03:00.000-07:00</published><updated>2008-06-20T08:13:10.402-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><category scheme='http://www.blogger.com/atom/ns#' term='ajax'/><title type='text'>Accessing ScriptManager</title><content type='html'>Apparently we can have only one script manager in a page so the normal practice is to add it in a Master page to be accessed by all pages. Sometimes you need to access the script manager in the code for example to register a button for an asynchronous call etc. It could be easily done by using the following method.&lt;br /&gt;&lt;br /&gt;ScriptManager.GetCurrent(this.Page);&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;An example to register a control for an asynchronous call from a user control.&lt;br /&gt;&lt;br /&gt;ScriptManager.GetCurrent(this.Page).RegisterAsyncPostBackControl(btnUpdate);&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-508836552425072368?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/508836552425072368/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=508836552425072368' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/508836552425072368'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/508836552425072368'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2008/06/accessing-scriptmanager.html' title='Accessing ScriptManager'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-7377247550953285796</id><published>2007-03-14T08:26:00.001-07:00</published><updated>2007-03-14T08:31:33.403-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Date formatting</title><content type='html'>Some of the formats for date formatting.&lt;br /&gt;&lt;strong&gt;specifier type output&lt;/strong&gt;&lt;br /&gt;dd      Day     08 &lt;br /&gt;ddd Short Day Name Mon &lt;br /&gt;dddd Full Day Name Monday &lt;br /&gt;hh 2 digit hour 12 &lt;br /&gt;HH 2 digit hour (24 hour) 12 &lt;br /&gt;mm 2 digit minute 30 &lt;br /&gt;MM Month 06 &lt;br /&gt;MMM Short Month name Jun &lt;br /&gt;MMMM Month name June &lt;br /&gt;ss seconds 59 &lt;br /&gt;tt AM/PM PM &lt;br /&gt;yy 2 digit year 70 &lt;br /&gt;yyyy 4 digit year 1970 &lt;br /&gt;: seperator, e.g. {0:hh:mm:ss} 12:30:59 &lt;br /&gt;/ seperator, e.g. {0:dd/MM/yyyy} 08/06/1970 &lt;br /&gt;&lt;br /&gt;Can simply be used with string as well.&lt;br /&gt;for example,&lt;br /&gt;string date=DateTime.Now.ToString("yyyy");&lt;br /&gt;&lt;br /&gt;In some controls there is a DataFormatString property as well:&lt;br /&gt;DataFormatString="{0:g}"&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-7377247550953285796?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/7377247550953285796/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=7377247550953285796' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/7377247550953285796'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/7377247550953285796'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2007/03/date-formatting.html' title='Date formatting'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-3021252624514694164</id><published>2007-03-01T05:38:00.000-08:00</published><updated>2007-03-01T05:40:00.684-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='.NET 2'/><category scheme='http://www.blogger.com/atom/ns#' term='Transactions'/><title type='text'>TransactionScope</title><content type='html'>While developing applications we often need to handle transactions. Before .NET 2 various options were available like ADO.NET Transaction model, Enterprise Services Transactions etc but the new TransactionScope has really made it easy to manage transactions.&lt;br /&gt;With transactions scope we can do transactions across multiple application layers as well as the distributed ones. &lt;br /&gt;The good news is that System.Transactions has the unique capability of knowing whether to use a distributed or lightweight transaction. It will use a lightweight transaction if there is a single domain accessing a single database, or it will use a distributed transaction similar to the enterprise services transaction model if there are multiple databases to access.&lt;br /&gt;&lt;br /&gt;To use this new transaction functionality we need to add the namespace System.Transactions.&lt;br /&gt;&lt;br /&gt;To use the TransactionScope we can simply add it in a using block like this&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; using (TransactionScope ts = new TransactionScope())&lt;br /&gt; {&lt;br /&gt; // code goes here &lt;br /&gt; //and once we are done to complete the transaction&lt;br /&gt; ts.Complete();&lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;br /&gt;Different options are available with TransactionScope which could be exploited according to needs.&lt;br /&gt;&lt;br /&gt;One thing to be taken into consideration is that if applications or components involved in a transaction are not residing on the same machine we need to do some settings else an exception like the given below could be raised.&lt;br /&gt;&lt;br /&gt;{"The transaction has already been implicitly or explicitly committed or aborted."}&lt;br /&gt;    System.Transactions.TransactionException: {"The transaction has already been implicitly or explicitly committed or aborted."}&lt;br /&gt;&lt;br /&gt;To overcome this problem we need to set up MSDTC in both the systems.&lt;br /&gt;&lt;br /&gt;Setup both the systems to allow transactions by following these steps&lt;br /&gt;&lt;br /&gt;• Open the Control Panel and select Administrative Tools.&lt;br /&gt;• From Administrative Tools select Component Services.&lt;br /&gt;• Open the Component Services tree to display My Computer.&lt;br /&gt;• Right click My Computer and select properties to display the properties dialog.&lt;br /&gt;• In the dialog select the MSDTC tab and click the Security Configuration button.&lt;br /&gt;• In the Security Configuration dialog, make sure Allow Inbound, Allow Outbound and No Authentication Required are selected.&lt;br /&gt;&lt;br /&gt;Considering an application running on Win2003 and communicating with SQL server on a machine with Win2k there are not security setting required for Win2k. In that case “No Authentication Required” should be selected on the application server.&lt;br /&gt;&lt;br /&gt;For more details on Transactions: http://msdn2.microsoft.com/en-us/library/w97s6fw4.aspx&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-3021252624514694164?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/3021252624514694164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=3021252624514694164' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/3021252624514694164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/3021252624514694164'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2007/03/transactionscope.html' title='TransactionScope'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-4249872562295031768</id><published>2007-02-22T02:38:00.000-08:00</published><updated>2007-02-22T02:48:16.225-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Events'/><title type='text'>Microsoft TechDays 2007</title><content type='html'>I recently got the opportunity to attend Microsoft TechDays 2007 held in Paris, France. The main objective of the occasion was to gather all the events like DevDays, Student days etc and organize an event which would address all the people including developers, architects, students, entrepreneurs etc. &lt;br /&gt;The event lasted for 3 days with many industry stands as well more than 250 sessions on different technologies. The event was attended by a large tech community and overall it was a great success for Microsoft. The event gave an overall view of the new trends in technology especially Windows Vista, .NET 3 etc.&lt;br /&gt;I found that event really interesting and informative and hope that Microsoft would continue to organize events of that sort.&lt;br /&gt;&lt;br /&gt;TechDays Blog:&lt;br /&gt;&lt;a href="http://blogs.technet.com/mstechdays/archive/2007/02/12/inside-the-microsoft-techdays-r-capitulatif-des-vid-os-disponibles-en-ligne.aspx"&gt;http://blogs.technet.com/mstechdays/archive/2007/02/12/inside-the-microsoft-techdays-r-capitulatif-des-vid-os-disponibles-en-ligne.aspx&lt;/a&gt;&lt;a href="http://blogs.technet.com/mstechdays/archive/2007/02/12/inside-the-microsoft-techdays-r-capitulatif-des-vid-os-disponibles-en-ligne.aspx"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-4249872562295031768?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/4249872562295031768/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=4249872562295031768' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4249872562295031768'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/4249872562295031768'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2007/02/microsoft-techdays-2007.html' title='Microsoft TechDays 2007'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-8947098357699019748.post-5082231761637970868</id><published>2007-02-22T02:19:00.000-08:00</published><updated>2007-02-22T06:46:58.629-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ASP.NET'/><title type='text'>Open blank page from ASP.NET Menu</title><content type='html'>I recently had this issue of opening a blank page through ASP.NET menu using treeview and sitemap. Apparently there is no easy option of doing it. But with a little bit of trick this could be achieved.&lt;br /&gt;To open a blank page using a sitemap we can add a javascript in the url attribute of sitemap note.&lt;br /&gt;&lt;br /&gt;An example:&lt;br /&gt;&lt;br /&gt;A node by clicking which the blank page should be opened.&lt;br /&gt;&lt;br /&gt;sitemapnode title="Procédures" description="Procédures" url="javascript:OpenBlankPage();"&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;and in the javacript function&lt;br /&gt;function OpenBlankPage() {&lt;br /&gt;window.open('site url here');&lt;br /&gt;return;&lt;br /&gt;}&lt;br /&gt;Javascript could directly be added in the url as well.&lt;br /&gt;Voila a small tip which could save you some time.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/8947098357699019748-5082231761637970868?l=khurramdotnet.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://khurramdotnet.blogspot.com/feeds/5082231761637970868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=8947098357699019748&amp;postID=5082231761637970868' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/5082231761637970868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/8947098357699019748/posts/default/5082231761637970868'/><link rel='alternate' type='text/html' href='http://khurramdotnet.blogspot.com/2007/02/open-blank-page-from-aspnet-menu.html' title='Open blank page from ASP.NET Menu'/><author><name>Khurram Shehzad</name><uri>http://www.blogger.com/profile/08236160867041585466</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
