<?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>rousso.eu &#187; ASP.NET</title>
	<atom:link href="http://rousso.eu/?feed=rss2&#038;cat=7" rel="self" type="application/rss+xml" />
	<link>http://rousso.eu</link>
	<description>a Greek guy, writing from Sweden, his blog in the States.</description>
	<lastBuildDate>Tue, 22 Jun 2010 16:51:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Multiple calls to RegisterOnSubmitStatement and Client-Side Validation</title>
		<link>http://rousso.eu/?p=13</link>
		<comments>http://rousso.eu/?p=13#comments</comments>
		<pubDate>Sat, 02 Dec 2006 08:54:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=3</guid>
		<description><![CDATA[Ok! Here is a new thing I discovered yet again the hard way&#8230; In short: Do not call Page.ClientScript.RegisterOnSubmitStatement after the Page Load event. (What?!) Well yes! It&#8217;s not under all circumstances that you can notice the difference but it&#8217;s there and it&#8217;s major! I do not really wan to describe this, so I &#8216;ll [...]]]></description>
			<content:encoded><![CDATA[<div class="ExternalClass03F95B4ADC804EE39AAD32C3FF903CC5">
<div>
<p>Ok! Here is a new thing I discovered yet again the hard way&#8230;</p>
<p><strong>In short:</strong> Do not call Page.ClientScript.RegisterOnSubmitStatement after the Page Load event.</p>
<p>(What?!)</p>
<p>Well yes! It&#8217;s not under all circumstances that you can notice the difference but it&#8217;s there and it&#8217;s major!</p>
<p>I do not really wan to describe this, so I &#8216;ll take you though it with <strong>an example</strong>:</p>
<p>Let&#8217;s say you have an aspx page. The page has two controls in it. For simplicity lets make those controls UserControls. The controls are pretty simple: just a TextBox and a RequiredFieldValidator in each of them.</p>
<p>So there you have it:</p>
<p><strong>Control A</strong> (let&#8217;s call it OnSubmitControlA):</p>
<pre class="brush: xml;">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitControlA.ascx.cs&quot; Inherits=&quot;OnSubmitControlA&quot; %&gt;
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; /&gt;
&lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;TextBox1&quot; ErrorMessage=&quot;RequiredFieldValidator&quot; /&gt;</pre>
<p>and the code file:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlA : System.Web.UI.UserControl
{
   protected override void OnPreRender(EventArgs e)
   {
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
      base.OnPreRender(e);
   }
}</pre>
</p></div>
<div>
<p><strong>Control B</strong> (let&#8217;s call it OnSubmitControlB):</p>
<pre class="brush: xml;">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitControlB.ascx.cs&quot; Inherits=&quot;OnSubmitControlB&quot; %&gt;
&lt;asp:TextBox ID=&quot;TextBox1&quot; runat=&quot;server&quot; /&gt;
&lt;asp:RequiredFieldValidator ID=&quot;RequiredFieldValidator1&quot; runat=&quot;server&quot; ControlToValidate=&quot;TextBox1&quot; ErrorMessage=&quot;RequiredFieldValidator&quot; /&gt;</pre>
<p>and the code file:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlB : System.Web.UI.UserControl
{
   protected override void OnPreRender(EventArgs e)
   {
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>And finally <strong>the page</strong> itself:</p>
<pre class="brush: xml;">&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeFile=&quot;OnSubmitTest.aspx.cs&quot; Inherits=&quot;OnSubmitTest&quot; %&gt;
&lt;%@ Register Src=&quot;OnSubmitControlA.ascx&quot; TagName=&quot;OnSubmitControlA&quot; TagPrefix=&quot;uc1&quot; %&gt;
&lt;%@ Register Src=&quot;OnSubmitControlB.ascx&quot; TagName=&quot;OnSubmitControlB&quot; TagPrefix=&quot;uc2&quot; %&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; &gt;
   &lt;head runat=&quot;server&quot;&gt;
      &lt;title&gt;Test Page&lt;/title&gt;
   &lt;/head&gt;
   &lt;body&gt;
      &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
         &lt;uc1:OnSubmitControlA ID=&quot;OnSubmitControlA1&quot; runat=&quot;server&quot; /&gt;
         &lt;uc2:OnSubmitControlB ID=&quot;OnSubmitControlB1&quot; runat=&quot;server&quot; /&gt;
         &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; Text=&quot;Button&quot; /&gt;
      &lt;/form&gt;
   &lt;/body&gt;
&lt;/html&gt;</pre>
<p>(the codefile has nothing special in it&#8230;)</p>
<p>The page has of course a submit button so that we can submit and test it&#8230;</p>
<p>So! What we have here!?</p>
<ul>
<li>A Page, </li>
<li>two controls that wan to access client-side code just before the page submits (for no particular reason) </li>
<li>and at least a Validator Control that will fail validation at some point. (If we did not have a validator then I would not have a case here!) </li>
</ul>
<p>Now go render the page an <strong>see the result</strong>. If you leave either TextBox empty and click on the submit button, you will notice that only the alert from the first control pop&#8217;s up. The other registered script is never called&#8230;.</p>
<p>Now go back and make a slight change. <strong>Move in both</strong> contols&#8217; codefile the call to Page.ClientScript.RegisterOnSubmitStatement from OnPreRender to OnLoad, like this:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlA : System.Web.UI.UserControl
{
   protected override void OnLoad(EventArgs e)
   {
      base.OnLoad(e);
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
   }
   protected override void OnPreRender(EventArgs e)
   {
      // Let's comment this out
      // Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomething&quot;, &quot;alert('This alert is registered by OnSubmitControlA');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>do the same on the other control:</p>
<pre class="brush: csharp;">public partial class OnSubmitControlB : System.Web.UI.UserControl
{
   protected override void OnLoad(EventArgs e)
   {
      base.OnLoad(e);
      Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
   }
   protected override void OnPreRender(EventArgs e)
   {
      // Let's comment this out also
      // Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), &quot;DoingSomethingElse&quot;, &quot;alert('This alert is registered by OnSubmitControlB');&quot;);
      base.OnPreRender(e);
   }
}</pre>
<p>Done! Go back and render the page! Leave either TextBox empty and click submit&#8230; See??? <strong>Now both alerts pop up!!!</strong></p>
<p>Why is that???</p>
<p>Well <strong>look at the source</strong> of the rendered page <strong>before and after the change</strong> to see what&#8217; going on:</p>
<p>Here is the script rendered when the call to RegisterOnSubmitStatement is placed in the <strong>OnPreRender</strong> event:</p>
<pre class="brush: js;">&lt;script type=&quot;text/javascript&quot;&gt;
   &lt;!--
      function WebForm_OnSubmit() {
         alert('This is registered by OnSubmitControlA');
         if (typeof(ValidatorOnSubmit) == &quot;function&quot; &amp;&amp; ValidatorOnSubmit() == false)
            return false;
         alert('This is registered by OnSubmitControlB');
         return true;
      }
   // --&gt;
&lt;/script&gt;</pre>
<p>And here is the script rendered when the call to RegisterOnSubmitStatement is placed in the <strong>OnLoad</strong> event:</p>
<pre class="brush: js;">&lt;script type=&quot;text/javascript&quot;&gt;
    &lt;!--
    function WebForm_OnSubmit() {
        alert('This is registered by OnSubmitControlA');
        alert('This is registered by OnSubmitControlB');
        if (typeof(ValidatorOnSubmit) == &quot;function&quot; &amp;&amp; ValidatorOnSubmit() == false)
            return false;
        return true;
       }
   // --&gt;
&lt;/script&gt;</pre>
<p>Got it?</p>
<p>If RegisterOnSubmitStatement is called after OnLoad, then the first time it&#8217;s called the framework appends the statement that calls ValidatorOnSubmit() and returns false if it fails; (effectively blocking the rest of the script from executing). Subsequent calls of RegisterOnSubmitStatement (after OnLoad) are appended to the script generated by the first call (and get blocked by the effect I just described).</p>
<p>Instead, if all your calls to RegisterOnSubmitStatement come before the end of the OnLoad phase, then all registered scripts are appended to previously generated scripts before the eventual injection of the call to ValidatorOnSubmit().</p>
<p>Hoping for comments on this&#8230;</p>
</p></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=13</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UseSubmitBehavior &amp; GetPostBackEventReference</title>
		<link>http://rousso.eu/?p=17</link>
		<comments>http://rousso.eu/?p=17#comments</comments>
		<pubDate>Mon, 29 May 2006 08:00:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=6</guid>
		<description><![CDATA[funny thing… I needed a button (in an ASP.NET 2.0 page) to post-back and raise an event for another control. That means that I click a button but the post-back event is not handled by the button clicked but instead by another control on the same page. The easy way was to add a System.Web.UI.WebControls.Hyperlink [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>funny thing…</p>
<p>I needed a button (in an ASP.NET 2.0 page) to <strong>post-back and raise an event for another control</strong>. That means that I click a button but the post-back event is not handled by the button clicked but instead by another control on the same page.</p>
<p>The easy way was to add a System.Web.UI.<strong>WebControls.Hyperlink</strong> and set its <strong>NavigateUrl</strong> property to Page.ClientScript.<strong>GetPostBackClientHyperlink</strong>(myOtherControl, &quot;Arguments&quot;)</p>
<p>But I wanted it to look like a Button so instead I added a System.Web.UI.<strong>HTMLControls.HTMLButton</strong> Control and did the same thing to its <strong>OnClientClick</strong> property.</p>
<p>All worked fine.</p>
<p>The funny thing happened when I decided that I like most to use a System.Web.UI.<strong>WebControls.Button </strong>instead.</p>
<p>ASP.NET Buttons are rendered as &lt;input type<strong>=&quot;submit&quot;</strong> /&gt; controls. and by default their client-side onClick event is wired to the <strong>__doPostBack </strong>javascript method by ASP.NET.</p>
<p>To change that behavior in ASP.NET 2.0 we are supposed to use the <strong>UseSubmitBehavior</strong> Property which when set to false causes the Button to be rendered as &lt;input type=<strong>&quot;button&quot; </strong>/&gt; and allows you to set the client-side onClick event programmatically (or declaratively) by setting the <strong>OnClientClick</strong> server-side Property.</p>
<p>That&#8217;s what I did, only to discover that to whatever I was assigning to the OnClientClick Property, <strong>the original __doPostBack call was automatically appended</strong> by the framework.</p>
<p>I did not spend all the time in the world to figure this out and as I failed to find a reasonable way out of the problem, what I did, was to <strong>trick</strong> the client-side out of it by appending a JavaScript “<strong>return;</strong>” statement to the script I was assigning to OnClicntClick.</p>
<p>To make all these more obvious here is the hands on:</p>
<p>in the <strong>aspx/ascx</strong> file:</p>
<pre class="brush: xml;">&lt;asp:detailsview id=&quot;DetailsView1&quot; runat=&quot;server&quot;&gt;
 ...
&lt;/asp:detailsview&gt;

&lt;asp:HyperLink ID=&quot;HyperLink1&quot; runat=&quot;server&quot; Text=&quot;HyperLink&quot; /&gt;
&lt;input id=&quot;Button1&quot; type=&quot;button&quot; value=&quot;button1&quot; runat=&quot;server&quot;/&gt;
&lt;asp:Button ID=&quot;Button2&quot; runat=&quot;server&quot; Text=&quot;Button2&quot; /&gt;</pre>
<p>Notice that lines 5 and 6 above define the Hyperlink and HTMLButton that worked fine and line 7 defines the WebControls.Button that did not behave. Lines 1 to 3 define a <strong>DetailsView</strong> just because that is the control I wanted to handle the post-back event.</p>
<p>Now in the <strong>code file</strong>:</p>
<pre class="brush: csharp;">HyperLink1.NavigateUrl = Page.ClientScript.GetPostBackClientHyperlink(DetailsView1, &quot;New$0&quot;, true);
Button1.Attributes.Add(&quot;onClick&quot;, Page.ClientScript.GetPostBackClientHyperlink(DetailsView1, &quot;New$0&quot;, true));
Button2.UseSubmitBehavior = false;
Button2.OnClientClick = Page.ClientScript.GetPostBackEventReference(DetailsView1, &quot;New$0&quot;);</pre>
<p>These get <strong>rendered as follows</strong> at run-time (if you look at the source in the browser):</p>
<pre class="brush: csharp;">&lt;a id=&quot;HyperLink1&quot; href=&quot;javascript:__doPostBack('DetailsView1','New$0')&quot;&gt;HyperLink&lt;/a&gt;
&lt;input name=&quot;Button1&quot; type=&quot;button&quot; id=&quot;Button1&quot; value=&quot;button&quot; onclick=&quot;javascript:__doPostBack('DetailsView1','New$0')&quot; /&gt;
&lt;input type=&quot;button&quot; name=&quot;Button2&quot; value=&quot;Button&quot; id=&quot;Button2&quot; onclick=&quot;__doPostBack('DetailsView1','New$0'); __doPostBack('Button2','')&quot; /&gt;</pre>
<p>This works just fine if you click on the Hyperlink1 or Button1 controls, but not at all if you clicked at Button2. That is because Button2 makes the <strong>call to __doPostBack twice</strong>. Once because I asked it to do so (by assigning its OnClientClick Property as you see in line 4 of the code-file above) and once because the framework automatically inserted the default post-back event reference for the button (Button2) itself.</p>
<p>To overcome this behavior (as I could not find another way around it) I just changed the last line in the code-file (line 4 in the snippet) by appending a <strong>javascript return statement</strong> as follows:</p>
<pre class="brush: csharp; first-line: 4;">Button2.OnClientClick = Page.ClientScript.GetPostBackEventReference(DetailsView1, &quot;New$0&quot;) + &quot;; return;&quot;;</pre>
<p>This caused Button2 to render as follows:</p>
<pre class="brush: xml; first-line: 3;">&lt;input type=&quot;button&quot; name=&quot;Button2&quot; value=&quot;Button&quot; id=&quot;Button2&quot; onclick=&quot;__doPostBack('DetailsView1','New$0'); return;__doPostBack('Button2','')&quot; /&gt;</pre>
<p>Notice the return statement (in bold) rendered between the two calls to __doPostBack. Although this does not prevent the second __doPostBack call from beeing inserted by the framework, it does prevent it from executing….</p>
<p>If you know a proper way out of this little puzzle&#160; please let me know….</p>
<p>P.S:</p>
<ol>
<li>
<p>As you obviously noticed I needed the button to create an <strong>Insert</strong> button that would enable a <strong>DetailsView</strong> to go to Insert Mode even if the view has <strong>no items</strong> to display. The button (when clicked) causes the DetailsView to receive an Insert Command.</p>
</li>
<li>
<p>Of course <strong>you fortunately do not need to do all this</strong> to make a details view to enter Insert Mode. It would be enough to just and any button with a server-side Click event handler changing the mode to Insert by just calling DetailsView1.<strong>ChangeMode(DetailsViewModes.Insert)</strong>;</p>
</li>
</ol>
<div></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=17</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET 2.0 Experiences</title>
		<link>http://rousso.eu/?p=19</link>
		<comments>http://rousso.eu/?p=19#comments</comments>
		<pubDate>Wed, 23 Nov 2005 09:03:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=8</guid>
		<description><![CDATA[With this post I am opening a series -hopefully- of posts, based on my experiences with ASP.NET 2.0. This post by itself is at the moment incomplete. I have been programming ASP.NET since version 1.0 and did most of my work in ASP.NET 1.1. Only recently, and just after the release of Visual Studio 2005 and [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>With this post I am opening a series -hopefully- of posts, based on my experiences with ASP.NET 2.0. This post by itself is at the moment incomplete.</p>
<p>I have been programming ASP.NET since version 1.0 and did most of my work in ASP.NET 1.1. Only recently, and just after the release of Visual Studio 2005 and the .Net Framework 2.0 I started working in ASP.NET 2.0. I have two initial goals to accomplish (apart from learning all the new and changed features of the new release):</p>
<ul>
<li>I want to port my version 1.1 code libraries to ASP.NET 2.0
<li>I want to create a web project I had in mind for the last couple of months in ASP.NET 2.0</li>
</ul>
<p>In the future I will probably work in ASP.NET 2.0 exclusively and I also might want to port some of my version 1.1 apps to version 2.0.</p>
<p>My first findings so far: </p>
<ul>
<li>ASP.NET 2.0 includes a framework for web site membership, role based security, and personalization. It is based on the same authentication and authorization mechanisms that come from version 1.1 but introduces the use of a data store and a &#8220;provider&#8221; API to support the new features. Previously I used to use my own implementation of such features using a custom solution. The new version makes my relevant code somewhat obsolete. I am already trying membership, roles and profiles and finding them easy and helpful. I &#8216;ll get back to you with more specifics on this&#8230;</li>
</ul>
<p>&#8230;to be continued&#8230;</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=19</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Funny Surprises With .NET 2.0</title>
		<link>http://rousso.eu/?p=20</link>
		<comments>http://rousso.eu/?p=20#comments</comments>
		<pubDate>Fri, 18 Nov 2005 09:05:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=9</guid>
		<description><![CDATA[As I was developing applications for .Net Framework 1.0 and 1.1, I was building a couple of code libraries with features I found smart and useful for my apps. Being an active member of dotNetZone.gr, (a Greek .net developer community often nicknamed DNZ), I recently decided to share some of that code with others in [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>As I was developing applications for .Net Framework 1.0 and 1.1, I was building a couple of code libraries with features I found smart and useful for my apps.</p>
<p>Being an active member of dotNetZone.gr, (a Greek .net developer community often nicknamed DNZ), I recently decided to share some of that code with others in DNZ.</p>
<p>The idea was to do that while porting the code to .Net Framework 2.0 through Visual Studio 2005.</p>
<p>Now, what’s so funny about that?</p>
<p>First thing I wanted to share was my Wizard classes. I implemented them in the context of a web project and used to find them brilliant.</p>
<p>Using SourceSafe Ι started today pinning and branching code to a new VS 2005 solution that would contain the part of my libraries related to Wizards.</p>
<p>“Come on! Where is the funny part?” you would still ask!</p>
<p>Well I compiled it and got the following compile time errors:</p>
<ul>
<li>Error1: &#8216;Wizard&#8217; is an ambiguous reference between &#8216;System.Web.UI.WebControls.Wizard&#8217; and &#8216;Softbone.Shared.Wizards.Wizard&#8217; 
<li>Error 2: &#8217;WizardStep&#8217; is an ambiguous reference between &#8216;System.Web.UI.WebControls.WizardStep&#8217; and &#8216;Softbone.Shared.Wizards.WizardStep&#8217; 
<li>Error 3 &#8217;WizardStepCollection&#8217; is an ambiguous reference between &#8216;System.Web.UI.WebControls.WizardStepCollection&#8217; and &#8216;Softbone.Shared.Wizards.WizardStepCollection&#8217; </li>
</ul>
<p><em>(note: Softbone is brand name I am using, and Softbone.Shared is the namespace of the shared code library I am creating porting my code from .net framework 1.1 to 2.0).</em></p>
<p>Ooops!</p>
<p>Not only Microsoft implemented the same functionality as I did, but the just happened to have chosen the same class names as I did!</p>
<p>Well that, I thought was funny enough to mention…</p>
<p>So, it might be the case that my library is obsolete with the new version of the .Net Framework, but still, here is what is more interesting about it now than ever: I have to check my implementation against Microsoft’s one to see where mine falls short or even if I did some things that are better or smarter than Microsoft’s.</p>
<p>So I will be posting my code soon to my main blog and my .net blog in DNZ and keep you posted here, to see if I have more interesting or funny encounters during my Wizard Library porting to .Net Framework 2.0.</p>
<p>I ‘ll let you know….</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=20</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VS.NET Copy Project</title>
		<link>http://rousso.eu/?p=10</link>
		<comments>http://rousso.eu/?p=10#comments</comments>
		<pubDate>Thu, 14 Jul 2005 08:22:00 +0000</pubDate>
		<dc:creator>rousso</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://rousso.gr/Lists/Posts/ViewPost.aspx?ID=18</guid>
		<description><![CDATA[Here is a solution for an issue I run into today. Issue: In VS.NET 2003 I tried to use the &#34;Copy Project&#34; feature to copy (deploy) the files required to run a web application to another web server. Nevertheless I got an error saying (more or less): &#8230;&#34;error occurred while copying the project&#34; &#8230; &#34;Visual [...]]]></description>
			<content:encoded><![CDATA[<div>
<p>Here is a solution for an issue I run into today.</p>
<p><strong>Issue:</strong></p>
<p>In VS.NET 2003 I tried to use the &quot;Copy Project&quot; feature to copy (deploy) the files required to run a web application to another web server. Nevertheless I got an error saying (more or less): &#8230;&quot;error occurred while copying the project&quot; &#8230; &quot;Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services&quot;.</p>
<p><strong>Context:</strong></p>
<p>I was evaluating Community Server 1.1 and I had a full source installation on my Windows XP workstation altering bits and pieces to customize the application. I had previously installed a binary installation of the same product to my Windows 2003 Web Server.</p>
<p><strong>Reactions:</strong></p>
<p>First I made sure ASP.NET was running on my remote web server. Just to be on the safe side I even run aspnet_regiis -i, but it did not fix the problem. I had never encountered an issue like that so I googled for it. I found similar problems but all had solutions I had already tried with no luck. So mine had to be different.</p>
<p><strong>Solution:</strong></p>
<p>I figured out what was wrong when I tried to find out what my VS.NET was doing on my workstation to determine the ASP.NET version on my remote web server. It turned out that VS.NET did an HTTP request to:</p>
<p><font face="Courier New">http://MyRemoteWebSrver/MyApplication/get_aspx_ver.aspx</font></p>
<p>This file (an actual ASPX page named get_aspx_ver.aspx) does not exist so the server returns the well known &quot;resource not found&quot; error page. But ASP.NET in that default error page, returns the .NET Framework version information which is in turn used by VS.NET to verify version information. Silly but true!</p>
<p>Now! The problem was that Community Server by default had defined Custom Error Pages. So suddenly it occurred to me and here is what I did to solve the problem:</p>
<p>I went to my remote web server, and added the following lines to the web.config of my application:</p>
<pre class="brush: xml;">&lt;location path=&quot;get_aspx_ver.aspx&quot;&gt;
   &lt;system.web&gt;
      &lt;customErrors mode=&quot;Off&quot; /&gt;
   &lt;/system.web&gt;
&lt;/location&gt;</pre>
<p>Solved!</p>
<p><font size="1" face="verdana">P.S: I also added the same lines to the web.config in my workstation since I was about to overwrite the web.config on the server. Remember I was originally trying to copy the files needed to run the project from my workstation to the web server using Copy Project feature of VS.NET.</font></p>
</p>
</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://rousso.eu/?feed=rss2&amp;p=10</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
