<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Fundamental Provocation &#187; Visual Studio</title> <atom:link href="http://www.ajaymatharu.com/category/visual-studio/feed/" rel="self" type="application/rss+xml" /><link>http://www.ajaymatharu.com</link> <description>Blog by Ajay Matharu</description> <lastBuildDate>Sun, 06 Nov 2011 15:09:39 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.3.1</generator> <xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" /> <item><title>The name does not exists in the current context asp.net</title><link>http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=the-name-does-not-exists-in-the-current-context-asp-net</link> <comments>http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/#comments</comments> <pubDate>Sun, 23 Jan 2011 16:20:25 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[asp.net control does not exists]]></category> <category><![CDATA[asp.net control does not exists in current context]]></category> <category><![CDATA[asp.net control does not exists in the current context]]></category> <category><![CDATA[asp.net control error]]></category> <category><![CDATA[asp.net server control error]]></category> <category><![CDATA[control does not exists in current context]]></category> <category><![CDATA[control does not exists in the current context]]></category> <category><![CDATA[name does not exists in current context]]></category> <category><![CDATA[the name does not exists in the corrent context]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=2548</guid> <description><![CDATA[Many a times while writing a code we get this error which says, &#8220;The name &#60;control&#62; does not exists in the current context&#8221;. This is because the code behind file is not able to find the control being added to your aspx file. There are three possible solutions for this error, 1 &#8211; There are [...]]]></description> <content:encoded><![CDATA[<p>Many a times while writing a code we get this error which says, &#8220;The name &lt;control&gt; does not exists in the current context&#8221;. This is because the code behind file is not able to find the control being added to your aspx file.</p><div id="attachment_2569" class="wp-caption aligncenter" style="width: 726px"><a rel="attachment wp-att-2569" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context/"><img class="size-full wp-image-2569 " title="Control does not exists in current context" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context.png" alt="Control does not exists in current context" width="716" height="444" /></a><p class="wp-caption-text">Control does not exists in current context</p></div><p>There are three possible solutions for this error,</p><p>1 &#8211; There are two classes with same name. Possibly you have renamed a page and created a new one, but you did not changed the name in the cs file. So make sure you have only one file with this name in your project. There may be two files with different name but same class name this may create problems.</p><p>2 &#8211; Multiple web.config files in your project. Make sure you have only one web.config file in your project. However you can have mulitple web.config files in your project but that has to be in particular format <a title="Working with mulitple web.config files" href="http://www.codeproject.com/KB/aspnet/multipleWebConfig.aspx" target="_blank">check here</a>.</p><p>3 &#8211; The designer file is not refreshed.</p><div id="attachment_2570" class="wp-caption aligncenter" style="width: 888px"><a rel="attachment wp-att-2570" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context_designer/"><img class="size-full wp-image-2570" title="control does not exists in current context designer file" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context_designer.png" alt="control does not exists in current context designer file" width="878" height="508" /></a><p class="wp-caption-text">control does not exists in current context designer file</p></div><p style="text-align: center;"><p>In this case you have to delete the existing designer file</p><p style="text-align: center;"><div id="attachment_2571" class="wp-caption aligncenter" style="width: 314px"><a rel="attachment wp-att-2571" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context_designer1/"><img class="size-full wp-image-2571  " title="delete web page designer file" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context_designer1.png" alt="delete web page designer file" width="304" height="513" /></a><p class="wp-caption-text">delete web page designer file</p></div><p>After deleting the file right click on the page, in this case default.aspx and select &#8220;Convert to web application&#8221;</p><div id="attachment_2572" class="wp-caption aligncenter" style="width: 549px"><a rel="attachment wp-att-2572" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context_designer2/"><img class="size-full wp-image-2572 " title="regenerate designer file - convert page to web application" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context_designer2.png" alt="regenerate designer file - convert page to web application" width="539" height="536" /></a><p class="wp-caption-text">regenerate designer file - convert page to web application</p></div><p>Once you convert it will prompt for confirmation just select yes</p><div id="attachment_2573" class="wp-caption aligncenter" style="width: 541px"><a rel="attachment wp-att-2573" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context_designer3/"><img class="size-full wp-image-2573 " title="web Page to web application conversion prompt" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context_designer3.png" alt="web Page to web application conversion prompt" width="531" height="203" /></a><p class="wp-caption-text">web Page to web application conversion prompt</p></div><p>Once converted you can see the added control declaration in the designer file.</p><div id="attachment_2574" class="wp-caption aligncenter" style="width: 865px"><a rel="attachment wp-att-2574" href="http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/control_does_not_exists_in_current_context_designer4/"><img class="size-full wp-image-2574" title="New designer file after converting page to web application" src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/control_does_not_exists_in_current_context_designer4.png" alt="New designer file after converting page to web application" width="855" height="529" /></a><p class="wp-caption-text">New designer file after converting page to web application</p></div><p style="text-align: center;"><p>Now you can use the control in your code behind.</p><p>Enjoy coding <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/the-name-does-not-exists-in-the-current-context-asp-net/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Multiple nodes with same URL were found in asp.net Sitemap</title><link>http://www.ajaymatharu.com/multiple-nodes-with-same-url-were-found-in-asp-net-sitemap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=multiple-nodes-with-same-url-were-found-in-asp-net-sitemap</link> <comments>http://www.ajaymatharu.com/multiple-nodes-with-same-url-were-found-in-asp-net-sitemap/#comments</comments> <pubDate>Tue, 11 Jan 2011 15:15:00 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[multiple nodes in asp.net]]></category> <category><![CDATA[Multiple nodes in sitemap]]></category> <category><![CDATA[multiple nodes in sitemap in asp.net]]></category> <category><![CDATA[multiple nodes with same url in asp.net]]></category> <category><![CDATA[multiple nodes with same url in sitemap in asp.net]]></category> <category><![CDATA[multiple nodes with the same url]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=2487</guid> <description><![CDATA[If you run through the following error in asp.net sitemap, The best solution to overcome this is to have the URL with a new querystring. Even if you are not using the querystring but if you pass any querystring it will resolve the above error.]]></description> <content:encoded><![CDATA[<p>If you run through the following error in asp.net sitemap,</p><p><div id="attachment_2489" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.ajaymatharu.com/multiple-nodes-with-same-url-were-found-in-asp-net-sitemap/sitemaperror-2/" rel="attachment wp-att-2489"><img src="http://www.ajaymatharu.com/wp-content/uploads/2011/01/sitemapError1-300x86.png" alt="Multiple notes asp.net sitemap error" title="Multiple notes asp.net sitemap error" width="300" height="86" class="size-medium wp-image-2489" /></a><p class="wp-caption-text">Multiple notes asp.net sitemap error</p></div><br /> The best solution to overcome this is to have the URL with a new querystring. Even if you are not using the querystring but if you pass any querystring it will resolve the above error.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/multiple-nodes-with-same-url-were-found-in-asp-net-sitemap/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>module was built either with optimizations enabled or without debug information</title><link>http://www.ajaymatharu.com/module-was-built-either-with-optimizations-enabled-or-without-debug-information/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=module-was-built-either-with-optimizations-enabled-or-without-debug-information</link> <comments>http://www.ajaymatharu.com/module-was-built-either-with-optimizations-enabled-or-without-debug-information/#comments</comments> <pubDate>Wed, 20 Oct 2010 01:13:27 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[error in debugging .net]]></category> <category><![CDATA[error in debugging vs.net]]></category> <category><![CDATA[mapping of dll in GAC]]></category> <category><![CDATA[optimization enabled]]></category> <category><![CDATA[problem while debugging]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=2059</guid> <description><![CDATA[The following module was built either with optimizations enabled or without debug information When you get the above error you can resolve it by the following way, Tools &#8211;&#62; Options &#8211;&#62; Debugging &#8211;&#62; General &#8211;&#62; Enable Just my code (Managed only) &#8211;&#62; un check &#34;Warn if no user code on launch&#34;&#160; I encountered this problem [...]]]></description> <content:encoded><![CDATA[<blockquote><div>The following module was built either with optimizations enabled or without debug information</div></blockquote><p>When you get the above error you can resolve it by the following way, Tools &#8211;&gt; Options &#8211;&gt; Debugging &#8211;&gt; General &#8211;&gt; Enable Just my code (Managed only) &#8211;&gt; un check &quot;Warn if no user code on launch&quot;&nbsp;</p><p>I encountered this problem in Visual Studio 2008 and like others here, my project settings did not have optimizations enabled and debugging information was configured. My problem turned out to be that the project assemblies stored in the GAC were from an older build. I think when I started debugging, VS tried to map between the GAC assemblies and the new source and could not do so and threw up this message. Deleting my old assemblies from the GAC resolved my issue.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/module-was-built-either-with-optimizations-enabled-or-without-debug-information/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Server Application Unavailable</title><link>http://www.ajaymatharu.com/server-application-unavailable/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=server-application-unavailable</link> <comments>http://www.ajaymatharu.com/server-application-unavailable/#comments</comments> <pubDate>Thu, 22 Apr 2010 04:15:51 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[asp.net 1.1]]></category> <category><![CDATA[asp.net 1.1 server error]]></category> <category><![CDATA[IIS]]></category> <category><![CDATA[server unavailable]]></category> <category><![CDATA[Virtual Directory Error]]></category> <category><![CDATA[vs.net]]></category><guid isPermaLink="false">http://ajaymatharu.wordpress.com/?p=458</guid> <description><![CDATA[Many a time while developing a web application you may come accross &#8220;Server application unavailable&#8221; When you get this error in Windows XP make sure you have given ASPNET user sufficient rights on your physical application folder, it mainly requires read permission. When you get this error in Windows 2003 server you can right click [...]]]></description> <content:encoded><![CDATA[<p>Many a time while developing a web application you may come accross &#8220;Server application unavailable&#8221;</p><p><a href="http://ajaymatharu.files.wordpress.com/2008/11/unavailable2.jpg"><img class="aligncenter size-full wp-image-463" title="unavailable2" src="http://ajaymatharu.files.wordpress.com/2008/11/unavailable2.jpg" alt="unavailable2" width="500" height="284" /></a></p><p>When you get this error in Windows XP make sure you have given ASPNET user sufficient rights on your physical application folder, it mainly requires read permission.</p><p>When you get this error in Windows 2003 server you can right click your virtual directory &#8211; permission &#8211; grant aspnet user sufficient rights there.</p><p>If the above solution doesn&#8217;t work here is another alternative,</p><p>You could try editing the Machine.config (located in<br /> C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFI G\).</p><p>Look for a key userName=&#8221;machine&#8221;. If you set it to &#8220;SYSTEM&#8221;<br /> instead the aspnet_wp.exe runs with a different user (with<br /> higher privileges).</p><p>Hope this helps</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/server-application-unavailable/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Changing the target framework for the setup file</title><link>http://www.ajaymatharu.com/changing-the-target-framework-for-the-setup-file/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=changing-the-target-framework-for-the-setup-file</link> <comments>http://www.ajaymatharu.com/changing-the-target-framework-for-the-setup-file/#comments</comments> <pubDate>Mon, 25 Jan 2010 08:36:49 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[Setup]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[.net framework]]></category> <category><![CDATA[application project]]></category> <category><![CDATA[Change target framework]]></category> <category><![CDATA[deployment project]]></category> <category><![CDATA[Framework]]></category> <category><![CDATA[framework version]]></category> <category><![CDATA[microsoft net framework]]></category> <category><![CDATA[Setup for Framework v2.0]]></category> <category><![CDATA[Setup Project]]></category> <category><![CDATA[Target Framework]]></category> <category><![CDATA[vs.net]]></category> <category><![CDATA[windows application]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1167</guid> <description><![CDATA[One of my team member, kunal, was facing a problem while creating the setup project for v 20 using VS 2008. Even after just changing the target framework while creating the project did no help so had to search for the solution, and the solution that solved our problem is as follows, 1) Create a [...]]]></description> <content:encoded><![CDATA[<p>One of my team member, <a href="http://kunalsidhpura.wordpress.com" target="_blank">kunal</a>, was facing a problem while creating the setup project for v 20 using VS 2008. Even after just changing the target framework while creating the project did no help so had to search for the solution, and the solution that solved our problem is as follows,</p><p><strong>1) Create a windows application project with target framework as v2.0</strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 692px"><strong><strong><img title="Select Framework" src="http://ajaymatharu.wordpress.com/files/2009/05/1selectframework.png" alt="Select Target Framework" width="682" height="313" /></strong></strong><p class="wp-caption-text">Select Target Framework</p></div><p><strong> </strong></p><p><strong>2) Create Setup and deployment project and select target framework as v2.0</strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 691px"><strong><strong><img title="Target framework for setup" src="http://ajaymatharu.wordpress.com/files/2009/05/2setupframework.png" alt="Target Framework for Setup" width="681" height="463" /></strong></strong><p class="wp-caption-text">Target Framework for Setup</p></div><p><strong> </strong></p><p><strong>3) Right-Click on setup project Name and select Properties, under properties select Prerequisites<br /> </strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 565px"><strong><strong><img title="select prerequisite" src="http://ajaymatharu.wordpress.com/files/2009/05/4prerequisite.png" alt="Select Prerequisite" width="555" height="440" /></strong></strong><p class="wp-caption-text">Select Prerequistes</p></div><p><strong> </strong></p><p><strong>4) Check .NET framework 2.0 and uncheck .NET framework 3.5</strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 512px"><strong><strong><img title="Select framework in prerequisite" src="http://ajaymatharu.wordpress.com/files/2009/05/5selectprerequisite.png" alt="Select Framework in Prerequisite" width="502" height="395" /></strong></strong><p class="wp-caption-text">Select Framework in Prerequisite</p></div><p><strong> </strong></p><p><strong>5) Under Solution Explorer double click on Microsoft.NET framework under</strong></p><p><strong> Setup project.</strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 267px"><strong><strong><img title="Select Framework" src="http://ajaymatharu.wordpress.com/files/2009/05/6framework.png" alt="Select the Framwork to change the version" width="257" height="226" /></strong></strong><p class="wp-caption-text">Select the Framwork to change the version</p></div><p><strong> </strong></p><p><strong>6) Right-Click on .NET framework select properties and change the version to v2.0&#8230;</strong></p><p><strong> </strong></p><div class="wp-caption aligncenter" style="width: 786px"><strong><strong><img title="Framework Version" src="http://ajaymatharu.wordpress.com/files/2009/05/8changeversion.png" alt="Change Framework Version" width="776" height="483" /></strong></strong><p class="wp-caption-text">Change Framework Version</p></div><p><strong> </strong></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/changing-the-target-framework-for-the-setup-file/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>ASP.Net menu control not working in Google Chrome</title><link>http://www.ajaymatharu.com/asp-net-menu-control-not-working-in-google-chrome/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=asp-net-menu-control-not-working-in-google-chrome</link> <comments>http://www.ajaymatharu.com/asp-net-menu-control-not-working-in-google-chrome/#comments</comments> <pubDate>Wed, 06 Jan 2010 07:01:40 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Chrome]]></category> <category><![CDATA[Internet Explorer]]></category> <category><![CDATA[asp.net menu control]]></category> <category><![CDATA[asp.net menu control in chrome]]></category> <category><![CDATA[asp.net menu control not working]]></category> <category><![CDATA[asp.net menu not working]]></category> <category><![CDATA[asp.net menu not working in chrome]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1980</guid> <description><![CDATA[ASP.Net menu controls breaks in Google Chrome and works fine in other browsers. Here is the hack to make it work in Google Chrome as well, if (Request.UserAgent.IndexOf("AppleWebKit") &#62; 0) Request.Browser.Adapters.Clear(); Just add this code on your page load and the menu control will start working fine in Google Chrome as well. Also some times [...]]]></description> <content:encoded><![CDATA[<p>ASP.Net menu controls breaks in Google Chrome and works fine in other browsers. Here is the hack to make it work in Google Chrome as well,</p><pre name="code" language="c#">
if (Request.UserAgent.IndexOf("AppleWebKit") &gt; 0)
     Request.Browser.Adapters.Clear();
</pre><p>Just add this code on your page load and the menu control will start working fine in Google Chrome as well.</p><p>Also some times the hover menus don&#8217;t work on IE8 to make it work on IE8 you need to set<br /><h2>&#8220;z-index&#8221;</h2><p> in DynamicMenuStyle property of the menu control.</p><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/asp-net-menu-control-not-working-in-google-chrome/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>SharePoint Error: &#8220;The language-neutral solution package was not found&#8221;</title><link>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=sharepoint-error-the-language-neutral-solution-package-was-not-found</link> <comments>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/#comments</comments> <pubDate>Fri, 27 Nov 2009 07:52:13 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Microsoft]]></category> <category><![CDATA[Sharepoint]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Language Neutral Package]]></category> <category><![CDATA[Sharepoint Error]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1765</guid> <description><![CDATA[Last night while developing an event listener custom list, I ran into this error, SharePoint Error: &#8220;The language-neutral solution package was not found&#8221; The solution to this problem is, Restart your visual studio. And it will be back to normal. Hope this helps]]></description> <content:encoded><![CDATA[<p>Last night while developing an event listener custom list, I ran into this error,</p><blockquote><div> SharePoint Error: &#8220;The language-neutral solution package was not found&#8221;</div></blockquote><p>The solution to this problem is, Restart your visual studio. And it will be back to normal.</p><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/sharepoint-error-the-language-neutral-solution-package-was-not-found/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Cannot create/shadow copy when that file already exists</title><link>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=cannot-createshadow-copy-when-that-file-already-exists</link> <comments>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/#comments</comments> <pubDate>Fri, 09 Oct 2009 06:49:21 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[Cache]]></category> <category><![CDATA[Hosting Environment]]></category> <category><![CDATA[Shadow Copy]]></category> <category><![CDATA[web.config]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1593</guid> <description><![CDATA[The .Net Framework has a feature called Shadow Copy. Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location. But this may create problem sometimes.]]></description> <content:encoded><![CDATA[<p>The .Net Framework has a feature called <span style="font-weight: bold;">Shadow Copy</span>.</p><p>Shadow copy is enabled on every appdomain created by ASP.NET by default. By default assemblies loaded will be copied to a shadow copy cache directory, and will be used from that location.</p><pre class="xml" name="code">
<hostingenvironment shadowcopybinassemblies="false">
</hostingenvironment>
</pre><p>But this may create <a title="Side effects of shadow copy bin assemblies" href="http://www.ajaymatharu.com/side-effect-of-shadowcopybinassemblies/" target="_blank">problem</a> sometimes.</p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/cannot-createshadow-copy-when-that-file-already-exists/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Export grid values in excel</title><link>http://www.ajaymatharu.com/export-grid-values-in-excel/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=export-grid-values-in-excel</link> <comments>http://www.ajaymatharu.com/export-grid-values-in-excel/#comments</comments> <pubDate>Wed, 07 Oct 2009 07:19:02 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[C#]]></category> <category><![CDATA[C#.Net]]></category> <category><![CDATA[Code]]></category> <category><![CDATA[Datatable]]></category> <category><![CDATA[Export]]></category> <category><![CDATA[export records to excel]]></category> <category><![CDATA[gridview]]></category> <category><![CDATA[gridview to excel]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1179</guid> <description><![CDATA[Following code helps you to import grid values to excel, //Import System.IO in your application for StreamWriter Object //note: excel_file represents the complete physical address of excel file eg C:/myexcel.xls public void export_datagridview_to_excel(DataGridView dgv, string excel_file) { int cols; //open file StreamWriter wr = new StreamWriter(excel_file); //determine the number of columns and write columns to [...]]]></description> <content:encoded><![CDATA[<p>Following code helps you to import grid values to excel,</p><pre class="c-sharp" name="code">
//Import System.IO in your application for StreamWriter Object

//note: excel_file represents the complete physical address of excel file eg  C:/myexcel.xls
public  void export_datagridview_to_excel(DataGridView dgv, string excel_file)
{
int cols;
//open file
StreamWriter wr = new StreamWriter(excel_file);

//determine the number of columns and write columns to file
cols = dgv.Columns.Count;
for (int i = 0; i &lt; cols; i++)
{
wr.Write(dgv.Columns[i].Name.ToString().ToUpper() + “\t”);
}

wr.WriteLine();

//write rows to excel file
for (int i = 0; i &lt; (dgv.Rows.Count - 1); i++)
{
for (int j = 0; j &lt; cols; j++)
{
if (dgv.RowsIdea.Cells[j].Value != null)
wr.Write(dgv.Rows[i].Cells[j].Value + “\t”);
else
{
wr.Write(”\t”);
}
}

wr.WriteLine();
}

//close file
wr.Close();
}</pre>]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/export-grid-values-in-excel/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Error catching in Global.asax</title><link>http://www.ajaymatharu.com/error-catching-in-global-asax/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=error-catching-in-global-asax</link> <comments>http://www.ajaymatharu.com/error-catching-in-global-asax/#comments</comments> <pubDate>Mon, 07 Sep 2009 03:53:22 +0000</pubDate> <dc:creator>Ajay Matharu</dc:creator> <category><![CDATA[.Net]]></category> <category><![CDATA[ASP.Net]]></category> <category><![CDATA[Development]]></category> <category><![CDATA[Visual Studio]]></category> <category><![CDATA[code snippet]]></category> <category><![CDATA[custom error]]></category> <category><![CDATA[Dot Net]]></category> <category><![CDATA[error handling]]></category> <category><![CDATA[global.asax]]></category> <category><![CDATA[httpcontext]]></category> <category><![CDATA[visual studio.net]]></category> <category><![CDATA[web.config]]></category><guid isPermaLink="false">http://www.ajaymatharu.com/?p=1635</guid> <description><![CDATA[The following code snippet will help you to catch an error in the global.asax file, Turn off the custom error mode in web.config file first, &#60;customErrors mode="Off"&#62; And add this code in your global.asax file to catch the error, void Application_Error(object sender, EventArgs e) { HttpContext context = ((HttpApplication)sender).Context; if (context.Error != null) { Exception [...]]]></description> <content:encoded><![CDATA[<p>The following code snippet will help you to catch an error in the global.asax file,</p><p>Turn off the custom error mode in web.config file first,</p><pre name="code" class="xml">&lt;customErrors mode="Off"&gt;</pre><p>And add this code in your global.asax file to catch the error,</p><pre name="code" class="c#">void Application_Error(object sender, EventArgs e)
 {
 HttpContext context = ((HttpApplication)sender).Context;
 if (context.Error != null)
 {
 Exception ex = context.Error;
 string msg = string.Empty;

 while (ex != null)
 {
 if (!string.IsNullOrEmpty(ex.Message))
 msg += ex.ToString() + "&lt;br /&gt;&lt;br /&gt;";
 ex = ex.InnerException;
 }
 context.Response.Clear();
 context.Response.Write(msg);
 context.Response.End();
 }
 } </pre><p>Hope this helps <img src='http://www.ajaymatharu.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p> ]]></content:encoded> <wfw:commentRss>http://www.ajaymatharu.com/error-catching-in-global-asax/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
