<?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>Interactive Logic &#187; ASP.NET</title>
	<atom:link href="http://interactivelogic.net/wp/tag/aspnet/feed/" rel="self" type="application/rss+xml" />
	<link>http://interactivelogic.net/wp</link>
	<description>Evan K. Stone on iOS Development and UX Design and Engineering</description>
	<lastBuildDate>Mon, 09 Apr 2012 16:25:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Easily refresh an UpdatePanel, using JavaScript [Encosia]</title>
		<link>http://interactivelogic.net/wp/2010/08/easily-refresh-an-updatepanel-using-javascript-encosia/</link>
		<comments>http://interactivelogic.net/wp/2010/08/easily-refresh-an-updatepanel-using-javascript-encosia/#comments</comments>
		<pubDate>Thu, 19 Aug 2010 18:57:09 +0000</pubDate>
		<dc:creator>Evan K. Stone</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">http://interactivelogic.net/wp/?p=143</guid>
		<description><![CDATA[Seems that I occasionally need to trigger the postback on an UpdatePanel, and invariably I forget between usages. Since this particular post from Encosia has saved my bacon on more than one occasion, I shall share it here (and for my own future benefit): Easily refresh an UpdatePanel, using JavaScript &#124; Encosia: I’ve noticed a [...]]]></description>
			<content:encoded><![CDATA[<p>Seems that I occasionally need to trigger the postback on an UpdatePanel, and invariably I forget between usages.</p>
<p>Since this particular post from <a href="http://encosia.com">Encosia</a> has saved my bacon on more than one occasion, I shall share it here (and for my own future benefit):</p>
<p><a href="http://encosia.com/2007/07/13/easily-refresh-an-updatepanel-using-javascript/">Easily refresh an UpdatePanel, using JavaScript | Encosia</a>:</p>
<blockquote><p>I’ve noticed a lot of discussion lately regarding methods to refresh an UpdatePanel via client script. This is very easy on the server side, of course. You can just call UpdatePanel.Update(). However, on the client side, the most common solutions I’ve been seeing just don’t feel right.  Many will advise you to use a hidden button control inside the UpdatePanel, manipulated via button.click(), to trigger a partial postback of the UpdatePanel. While it does work, I never have been able to get past the kludgey nature of that solution.</p></blockquote>
<p>In a nutshell, we can use the <strong>__doPostBack()</strong> method:</p>
<blockquote><p>Luckily, there’s an easy method for triggering a postback targeted at the UpdatePanel:   <strong>__doPostBack()</strong>.</p>
<p>As long as the event target of a __doPostBack() call is an async  trigger of an UpdatePanel, the ASP.NET AJAX framework will intercept the postback and fire a partial postback instead.  For purposes of  demonstration, I’m going to add that to the OnClick event of the  container div:</p>
<div class="wp_syntax">
<div class="code">
<pre class="asp" style="font-family: monospace;"><span style="color: #006600; font-weight: bold;">&lt;</span>div id<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">"Container"</span> onclick<span style="color: #006600; font-weight: bold;">=</span><span style="color: #cc0000;">"__doPostBack('UpdatePanel1', '');"</span><span style="color: #006600; font-weight: bold;">&gt;</span></pre>
</div>
</div>
<p>Now, clicking anywhere in the UpdatePanel will trigger a partial postback, targeting the UpdatePanel.  Since <a href="http://encosia.com/2007/10/24/are-you-making-these-3-common-aspnet-ajax-mistakes/">partial postbacks follow the full page lifecycle</a>, this will fire UpdatePanel1_Load and update the Label’s text.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://interactivelogic.net/wp/2010/08/easily-refresh-an-updatepanel-using-javascript-encosia/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting Session Variables in ASP.NET from JavaScript</title>
		<link>http://interactivelogic.net/wp/2010/08/setting-session-variables-in-asp-net-from-javascript/</link>
		<comments>http://interactivelogic.net/wp/2010/08/setting-session-variables-in-asp-net-from-javascript/#comments</comments>
		<pubDate>Fri, 06 Aug 2010 18:43:55 +0000</pubDate>
		<dc:creator>Evan K. Stone</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://interactivelogic.net/wp/?p=122</guid>
		<description><![CDATA[Someone on the ASP.NET forums asked how to set session variables in JavaScript. The answers given ranged from &#8220;totally wrong&#8221; to &#8220;rather misleading&#8221; or &#8220;marginally helpful&#8221;. So in a nutshell, yes, you can totally do it. Not only will you be able to do it, you will love doing it after you get used to [...]]]></description>
			<content:encoded><![CDATA[<p>Someone on the <a href="http://forums.asp.net/t/1064192.aspx" target="_blank">ASP.NET forums</a> asked how to set session variables in JavaScript. The answers given ranged from &#8220;totally wrong&#8221; to &#8220;rather misleading&#8221; or &#8220;marginally helpful&#8221;.</p>
<p>So in a nutshell, <strong>yes, you can totally do it</strong>. Not only will you be able to do it, you will love doing it after you get used to the process of getting it set up.</p>
<p>Here&#8217;s the recipe for success:</p>
<ul>
<li>Add an ASP.NET AJAX ScriptManager to your page.</li>
<li>Create a simple ASMX Web service using Visual Studio.</li>
<li>Uncomment the Attribute directly above the class definition that reads [System.Web.Script.Services.ScriptService] to enable ASP.NET AJAX to see your web methods.</li>
<li>Create a method to get or update data in your session, and make sure the Attribute above the web method reads [WebMethod(EnableSession = true)] so you can have access to the session via your web service method.</li>
<li>Add a &lt;Services&gt; section to your ScriptManager.</li>
<li>In the &lt;Services&gt; section add a &lt;ServiceReference&gt; element with the Path attribute set to the path of your .asmx page.</li>
</ul>
<p>OK, so that enables the ability to access your session from the client side.</p>
<p>But here&#8217;s the <strong>really awesome part</strong>:  if you include a reference to the web service in your .js file like so:</p>
<blockquote><p>///&lt;reference path=&#8221;~/MyServices/MyService.asmx&#8221; /&gt;</p></blockquote>
<p>&#8230;you will get <strong>IntelliSense in the JavaScript </strong>for your web service methods! it&#8217;s very cool.</p>
<p>So then you just call your web service methods like you would any other JavaScript function. It&#8217;s totally easy and almost magical. It&#8217;s one of my favorite features of ASP.NET AJAX.</p>
]]></content:encoded>
			<wfw:commentRss>http://interactivelogic.net/wp/2010/08/setting-session-variables-in-asp-net-from-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solved a problem with an Visual Studio 2008 &#8220;Source control provider could not be found&#8221; error&#8230;</title>
		<link>http://interactivelogic.net/wp/2010/07/solved-a-problem-with-an-visual-studio-2008-source-control-provider-could-not-be-found-error/</link>
		<comments>http://interactivelogic.net/wp/2010/07/solved-a-problem-with-an-visual-studio-2008-source-control-provider-could-not-be-found-error/#comments</comments>
		<pubDate>Wed, 14 Jul 2010 17:20:41 +0000</pubDate>
		<dc:creator>Evan K. Stone</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[annoyances]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[subversion]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://interactivelogic.net/wp/?p=111</guid>
		<description><![CDATA[I had run into this problem before. Setup I have my Visual Studio 2008 options set to reload the previously loaded solution on startup. I use Subversion. I use AnkhSVN as my SVN provider in Visual Studio 2008. Problem If I launched Visual Studio 2008 with a particular solution loaded when I last closed VS, [...]]]></description>
			<content:encoded><![CDATA[<p>I had run into this problem before.</p>
<p><strong>Setup</strong></p>
<ol>
<li> I have my Visual Studio 2008 options set to reload the previously loaded solution on startup.</li>
<li>I use Subversion.</li>
<li>I use AnkhSVN as my SVN provider in Visual Studio 2008.</li>
</ol>
<p><strong>Problem</strong><br />
If I launched Visual Studio 2008 with a particular solution loaded when I last closed VS, I would receive a &#8220;Source control provider could not be found&#8221; error.</p>
<p><em>However</em>&#8230; if I just launched it via double-clicking on the .SLN file in my file system, <strong>no error</strong>!!!</p>
<p>Weird.</p>
<p>OK &#8211; so I did a quick diff on a solution that I knew worked fine. Both had the expected source control provider information embedded:</p>
<pre>SccProjectName = "Svn"
SccAuxPath = "Svn"
SccLocalPath = "Svn"
SccProvider = "SubversionScc"</pre>
<p>However there was a difference.</p>
<p>The solution that did not generate the error message also contained the following block in the &#8220;Global&#8221; section:</p>
<pre>GlobalSection(SubversionScc) = preSolution
    Svn-Managed = True
    Manager = AnkhSVN - Subversion Support for Visual Studio
EndGlobalSection</pre>
<p>Which somehow got generated in one solution, but not the one causing problems. Once I copied the block from one solution to the other, the error message ceased to be shown on launch of VS2008.</p>
]]></content:encoded>
			<wfw:commentRss>http://interactivelogic.net/wp/2010/07/solved-a-problem-with-an-visual-studio-2008-source-control-provider-could-not-be-found-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running a javascript function after UpdatePanel.Update()</title>
		<link>http://interactivelogic.net/wp/2010/05/running-a-javascript-function-after-updatepanelupdate/</link>
		<comments>http://interactivelogic.net/wp/2010/05/running-a-javascript-function-after-updatepanelupdate/#comments</comments>
		<pubDate>Wed, 19 May 2010 17:23:45 +0000</pubDate>
		<dc:creator>Evan K. Stone</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://interactivelogic.net/wp/2010/05/running-a-javascript-function-after-updatepanelupdate/</guid>
		<description><![CDATA[Found this forum post to be very helpful and I think I may employ this more often when doing UpdatePanel related messaging-when-done&#8230; Run a javascript function after UpdatePanel.Update() &#8211; ASP.NET Forums: &#8230; You should call the method in this way: ScriptManager.RegisterStartupScript(this.Page, this.GetType(), &#8220;MyScriptName&#8221;, &#8220;&#60;script type=&#8217;text/javascript&#8217;&#62;functionToCall(&#8216;hello world&#8217;);&#60;/script&#62;&#8221;, false); The problem could be the fact that you [...]]]></description>
			<content:encoded><![CDATA[<p>Found this forum post to be very helpful and I think I may employ this more often when doing UpdatePanel related messaging-when-done&#8230;</p>
<p><a href="http://forums.asp.net/t/1073620.aspx">Run a javascript function after UpdatePanel.Update() &#8211; ASP.NET Forums</a>:</p>
<blockquote><p>&#8230;</p>
<p>You should call the method in this way:</p>
<p><strong>ScriptManager.RegisterStartupScript(this.Page, this.GetType(), &#8220;MyScriptName&#8221;, &#8220;&lt;script type=&#8217;text/javascript&#8217;&gt;functionToCall(&#8216;hello world&#8217;);&lt;/script&gt;&#8221;, false);</strong></p>
<p>The problem could be the fact that you are using <strong>this </strong>instead of <strong>this.Page</strong>. Also instead language=&#8217;javascript&#8217; you can use type=&#8217;text/javascript&#8217;.</p></blockquote>
<p>All I know is that when I launched the script properly passing this.Page it worked properly. I had derived from Page to a custom base page, so maybe that had something to do with it.</p>
<p>Additionally, I refined it just a bit by building the script dynamically in a string and then passing that instead of just a literal in the static method call.</p>
<p>One more improvement I was considering is to embed this as a method on my aforementioned customized base page. Then i can just pass a name and the script to the method, and I won&#8217;t have to worry about the messy details every time.</p>
]]></content:encoded>
			<wfw:commentRss>http://interactivelogic.net/wp/2010/05/running-a-javascript-function-after-updatepanelupdate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ASP.NET Logging to the Visual Studio Output Window with log4net</title>
		<link>http://interactivelogic.net/wp/2010/02/aspnet-logging-to-output-window-with-log4net/</link>
		<comments>http://interactivelogic.net/wp/2010/02/aspnet-logging-to-output-window-with-log4net/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 19:14:37 +0000</pubDate>
		<dc:creator>Evan K. Stone</dc:creator>
				<category><![CDATA[ASP.NET]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[annoyances]]></category>
		<category><![CDATA[open source]]></category>

		<guid isPermaLink="false">http://interactivelogic.net/wp/?p=59</guid>
		<description><![CDATA[OK this one has been baffling me for a long time but I just ignored it. We have been using the open source logging library log4net for a long time, and for the most part it was working fine. But the one thing that I wanted to do but could never get working was logging [...]]]></description>
			<content:encoded><![CDATA[<p>OK this one has been baffling me for a long time but I just ignored it. We have been using the open source logging library log4net for a long time, and for the most part it was working fine. But the one thing that I wanted to do but could never get working was logging to what my brain wanted to call &#8220;The Console,&#8221; AKA (to me) the Output window in Visual Studio.</p>
<p>I tried using the log4net appenders ConsoleAppender and ColoredConsoleAppender, to no avail. Turns out there&#8217;s a different appender that works with the Output window, and it&#8217;s not ConsoleAppender.</p>
<p>The appender in question is <a title="TraceAppender - log4net Documentation" href="http://logging.apache.org/log4net/release/sdk/log4net.Appender.TraceAppender.html" target="_blank">TraceAppender</a>!</p>
<p>So here&#8217;s a little snippet of XML from my web.config files that handles output to the Output window (basically the same markup as appears on <a title="TraceAppender - log4net Examples Page" href="http://logging.apache.org/log4net/release/config-examples.html#TraceAppender" target="_blank">the log4net examples page</a>):</p>
<pre>  &lt;/log4net&gt;
    &lt;appender name="TraceAppender" type="log4net.Appender.TraceAppender"&gt;
      &lt;layout type="log4net.Layout.PatternLayout"&gt;
        &lt;conversionPattern value="%d [%t] %-5p %c %m%n"/&gt;
      &lt;/layout&gt;
    &lt;/appender&gt;</pre>
<pre>    &lt;root&gt;
      &lt;level value="ALL"/&gt;
      &lt;appender-ref ref="TraceAppender"/&gt;
    &lt;/root&gt;
  &lt;/log4net&gt;</pre>
<p>To those familiar with the way the log4net section looks in your web.config this will make sense, but the key concept is that, per the log4net documentation, &#8220;Events are written using the System.Diagnostics.Trace.Write(string,string) method&#8221; &#8212; and it turns out that one of the listeners is the Output window!</p>
<p><a title="Nik Boyd - Educery.com" href="http://www.educery.com/" target="_blank">A colleague of mine</a> and I were very confused by all this (I&#8217;m glad I wansn&#8217;t alone in that feeling either!), but we were both very glad to figure this one out.</p>
<p>Thanks go to Google (of course), and <a title="SharpDevelop Forums" href="http://community.sharpdevelop.net/forums/p/4253/12203.aspx" target="_blank">this post</a> on the SharpDevelop forums.</p>
]]></content:encoded>
			<wfw:commentRss>http://interactivelogic.net/wp/2010/02/aspnet-logging-to-output-window-with-log4net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

