<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>The Wanderer</title>
    <link>http://www.jtower.com/blog/</link>
    <description>a blog by j. tower</description>
    <copyright>Jonathan Tower</copyright>
    <lastBuildDate>Fri, 20 Oct 2006 15:19:49 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.8.5223.2</generator>
    <managingEditor>j@jtower.com</managingEditor>
    <webMaster>j@jtower.com</webMaster>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=5851d6c8-eb39-436d-9a3f-ae22e14d42ec</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,5851d6c8-eb39-436d-9a3f-ae22e14d42ec.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,5851d6c8-eb39-436d-9a3f-ae22e14d42ec.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=5851d6c8-eb39-436d-9a3f-ae22e14d42ec</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Mad props to Craig Andera for his article on how to mix Windows Authentication
      with Forms/anonymous on an ASP.NET web site:
   </p>
        <p>
          <a href="http://pluralsight.com/blogs/craig/archive/2004/07/24/1699.aspx">http://pluralsight.com/blogs/craig/archive/2004/07/24/1699.aspx</a>
        </p>
        <p>
      I'm using this at my job to allow our support staff to automatically login to our
      customer's applications if they access the application from within our coporate network.
   </p>
        <p>
      Prittay, prittay, prittay cool!
   </p>
      </body>
      <title>Use Both Anonymous Access and Windows Authentication</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,5851d6c8-eb39-436d-9a3f-ae22e14d42ec.aspx</guid>
      <link>http://www.jtower.com/blog/UseBothAnonymousAccessAndWindowsAuthentication.aspx</link>
      <pubDate>Fri, 20 Oct 2006 15:19:49 GMT</pubDate>
      <description>&lt;p&gt;
   Mad props to Craig Andera for his article on how to mix&amp;nbsp;Windows Authentication
   with Forms/anonymous on an ASP.NET web site:
&lt;/p&gt;
&lt;p&gt;
   &lt;a href="http://pluralsight.com/blogs/craig/archive/2004/07/24/1699.aspx"&gt;http://pluralsight.com/blogs/craig/archive/2004/07/24/1699.aspx&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
   I'm using this at my job to allow our support staff to automatically login to our
   customer's applications if they access the application from within our coporate network.
&lt;/p&gt;
&lt;p&gt;
   Prittay, prittay, prittay cool!
&lt;/p&gt;</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,5851d6c8-eb39-436d-9a3f-ae22e14d42ec.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=a7b5a591-648c-4458-b785-08d4d9b6f9db</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,a7b5a591-648c-4458-b785-08d4d9b6f9db.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,a7b5a591-648c-4458-b785-08d4d9b6f9db.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a7b5a591-648c-4458-b785-08d4d9b6f9db</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      I created this control to create dropshadows on dynamic text.  I also considered
      using the Drawing namespace to generate an image and stream it.  I breifly even
      used Microsoft's IE-only filter:dropshadow css attribute.  The staw that broke
      the camels back on that was the fact that this filter looks terrible on XP machines
      with ClearType enabled.  I found an article about using a span within a div and
      repeating your contents twice (essentially creating a copy of your text, oversetting
      it, and changing its color).  I used this concept to create the server control
      described below.
   </p>
        <p>
      The DropShadow control acts like a panel in the sense that it contains controls and
      renders them within a &lt;div&gt; tag.  In addition to that, however, this control captures
      the text "output" by all it's child controls and contents and repeats it (without
      any HTML tags) in such a way that it acts as a drop shadow.<br /><br /><strong>Static Text Code:<br /></strong><font color="#0000ff" size="2">&lt;</font><font color="#800000" size="2">ctl</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">DropShadow</font><font color="#000000" size="2"></font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">="server"&gt;</font><font color="#000000" size="2">Search&lt;</font><font color="#800000" size="2"><font color="#0000ff">/</font>ctl:DropShadow</font><font color="#0000ff" size="2">&gt;</font><br /><br /><strong>Static Text Rendering:<br /></strong><img src="http://www.jtower.com/blog/content/binary/dropshadow.gif" border="0" /><br /><br /><strong>Static Text Rendering (Magnified):<br /></strong><img src="http://www.jtower.com/blog/content/binary/dropshadow_magnified.gif" border="0" /><br /><br /><br /><font color="#0000ff" size="2"></font></p>
        <p>
          <strong>
            <font color="#000000">Dynamic Control Code:<br /></font>
          </strong>&lt;<font color="#800000" size="2">ctl</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">DropShadow</font><font color="#000000" size="2"></font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">="server"&gt;&lt;</font><font color="#800000" size="2">asp</font><font color="#0000ff" size="2">:<font color="#800000">LinkButton </font></font><font color="#ff0000" size="2">id</font><font color="#0000ff" size="2">="lbnDisposition"</font><font color="#000000" size="2"></font><font color="#ff0000" size="2">Text</font><font color="#0000ff" size="2">="Status"</font><font color="#000000" size="2"></font><font color="#ff0000" size="2">runat</font><font color="#0000ff" size="2">="server" </font><font color="#0000ff" size="2">/</font><font color="#0000ff" size="2">&gt;&lt;/</font><font color="#800000" size="2">ctl</font><font color="#0000ff" size="2">:</font><font color="#800000" size="2">DropShadow</font><font color="#0000ff" size="2">&gt;</font></p>
        <p>
          <strong>
            <font color="#000000">Dynamic Control Rendering:</font>
          </strong>
          <br />
          <img src="http://www.jtower.com/blog/content/binary/dropshadow_dynamic.gif" border="0" />
          <br />
          <strong>
            <font color="#000000">
              <br />
      Dynamic Control Rendering (Magnified):</font>
          </strong>
          <br />
          <img src="http://www.jtower.com/blog/content/binary/dropshadow_dynamic_magnified.gif" border="0" />
          <br />
          <br />
      Notice in the second (dynamic) example that the &lt;a&gt; tag created by the LinkButton
      control is not repeated in the shadow, but the text is.<br /><br /><strong>Code:</strong></p>
        <pre style="PADDING-RIGHT: 10px; MARGIN-TOP: 0px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px">Public Class DropShadow : Inherits WebControls.Panel
  Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
    writer.Write("&lt;div style=""height:1px; display:inline; white-space:nowrap; " &amp; _
      "font-weight:bold; position:relative; left:1px; top:1px; color:" &amp; _
      GetHexCode(BackColor) &amp; ";""&gt;")

    'capture child control's output
    Dim result As New StringBuilder
    RenderChildren(New HtmlTextWriter(New IO.StringWriter(result)))
    Dim html As String = result.ToString()
    Dim rx As New Text.RegularExpressions.Regex( _
      "&lt;/?(\w+)(\s*\w*\s*=\s*(""[^""]*""|'[^']'|[^&gt;]*))*|/?&gt;", &amp; _
      RegularExpressions.RegexOptions.Multiline)
    html = rx.Replace(html, "")
    writer.Write(html)

    writer.Write("&lt;span style=""position:absolute; left:-1px; top:-1px; color:" &amp; _ 
      GetHexCode(ForeColor) &amp; "; width:100%;""&gt;")
    RenderChildren(writer)
    writer.Write("&lt;/span&gt;")

    writer.Write("&lt;/div&gt;")
  End Sub

  Private Function GetHexCode(ByVal Color As System.Drawing.Color) As String
    Return "#" &amp; Color.R.ToString("x2") &amp; _
      Color.G.ToString("x2") &amp; _
      Color.B.ToString("x2")
  End Function

  Public Sub New()
    'default colors
    Me.ForeColor = Drawing.Color.Black
    Me.BackColor = Drawing.Color.White
  End Sub
End Class</pre>
      </body>
      <title>ASP.NET Drop Shadow Control</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,a7b5a591-648c-4458-b785-08d4d9b6f9db.aspx</guid>
      <link>http://www.jtower.com/blog/ASPNETDropShadowControl.aspx</link>
      <pubDate>Tue, 21 Feb 2006 18:57:51 GMT</pubDate>
      <description>&lt;p&gt;
   I created this control to create dropshadows on dynamic text.&amp;nbsp; I also considered
   using the Drawing namespace to generate an image and stream it.&amp;nbsp; I breifly even
   used Microsoft's IE-only filter:dropshadow css attribute.&amp;nbsp; The staw that broke
   the camels back on that was the fact that this filter looks terrible on XP machines
   with ClearType enabled.&amp;nbsp; I found an article about using a span within a div and
   repeating your contents twice (essentially creating a copy of your text, oversetting
   it, and changing its color).&amp;nbsp; I used this concept to create the server control
   described below.
&lt;/p&gt;
&lt;p&gt;
   The DropShadow control acts like a panel in the sense that it contains controls and
   renders them within a &amp;lt;div&amp;gt; tag.&amp;nbsp; In addition to that, however, this control&amp;nbsp;captures
   the text "output" by all it's child controls and contents and repeats it (without
   any HTML tags)&amp;nbsp;in such a way that it acts as a&amp;nbsp;drop shadow.&lt;br&gt;
   &lt;br&gt;
   &lt;strong&gt;Static Text Code:&lt;br&gt;
   &lt;/strong&gt;&lt;font color=#0000ff size=2&gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;ctl&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;DropShadow&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&amp;gt;&lt;/font&gt;&lt;font color=#000000 size=2&gt;Search&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;&lt;font color=#0000ff&gt;/&lt;/font&gt;ctl:DropShadow&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;strong&gt;Static Text Rendering:&lt;br&gt;
   &lt;/strong&gt;&lt;img src="http://www.jtower.com/blog/content/binary/dropshadow.gif" border=0&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;strong&gt;Static Text Rendering (Magnified):&lt;br&gt;
   &lt;/strong&gt;&lt;img src="http://www.jtower.com/blog/content/binary/dropshadow_magnified.gif" border=0&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;br&gt;
   &lt;font color=#0000ff size=2&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Dynamic Control Code:&lt;br&gt;
   &lt;/font&gt;&lt;/strong&gt;&amp;lt;&gt;&lt;font color=#800000 size=2&gt;ctl&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;DropShadow&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server"&amp;gt;&amp;lt;&lt;/font&gt;&lt;font color=#800000 size=2&gt;asp&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;font color=#800000&gt;LinkButton &lt;/font&gt;&lt;/font&gt;&lt;font color=#ff0000 size=2&gt;id&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="lbnDisposition"&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;Text&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="Status"&lt;/font&gt;&lt;font color=#000000 size=2&gt; &lt;/font&gt;&lt;font color=#ff0000 size=2&gt;runat&lt;/font&gt;&lt;font color=#0000ff size=2&gt;="server" &lt;/font&gt;&lt;font color=#0000ff size=2&gt;/&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&amp;lt;/&lt;/font&gt;&lt;font color=#800000 size=2&gt;ctl&lt;/font&gt;&lt;font color=#0000ff size=2&gt;:&lt;/font&gt;&lt;font color=#800000 size=2&gt;DropShadow&lt;/font&gt;&lt;font color=#0000ff size=2&gt;&amp;gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;Dynamic Control Rendering:&lt;/font&gt;&lt;/strong&gt;
   &lt;br&gt;
   &lt;img src="http://www.jtower.com/blog/content/binary/dropshadow_dynamic.gif" border=0&gt;
   &lt;br&gt;
   &lt;strong&gt;&lt;font color=#000000&gt;
   &lt;br&gt;
   Dynamic Control Rendering (Magnified):&lt;/font&gt;&lt;/strong&gt;
   &lt;br&gt;
   &lt;img src="http://www.jtower.com/blog/content/binary/dropshadow_dynamic_magnified.gif" border=0&gt;
   &lt;br&gt;
   &lt;br&gt;
   Notice in the second (dynamic) example that the &amp;lt;a&amp;gt; tag created by the LinkButton
   control is not repeated in the shadow, but the text is.&lt;br&gt;
   &lt;br&gt;
   &lt;strong&gt;Code:&lt;/strong&gt;
&lt;/p&gt;
&lt;pre style="PADDING-RIGHT: 10px; MARGIN-TOP: 0px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"&gt;Public Class DropShadow : Inherits WebControls.Panel
  Protected Overrides Sub Render(ByVal writer As System.Web.UI.HtmlTextWriter)
    writer.Write("&amp;lt;div style=""height:1px; display:inline; white-space:nowrap; " &amp;amp; _
      "font-weight:bold; position:relative; left:1px; top:1px; color:" &amp;amp; _
      GetHexCode(BackColor) &amp;amp; ";""&amp;gt;")

    'capture child control's output
    Dim result As New StringBuilder
    RenderChildren(New HtmlTextWriter(New IO.StringWriter(result)))
    Dim html As String = result.ToString()
    Dim rx As New Text.RegularExpressions.Regex( _
      "&amp;lt;/?(\w+)(\s*\w*\s*=\s*(""[^""]*""|'[^']'|[^&amp;gt;]*))*|/?&amp;gt;", &amp;amp; _
      RegularExpressions.RegexOptions.Multiline)
    html = rx.Replace(html, "")
    writer.Write(html)

    writer.Write("&amp;lt;span style=""position:absolute; left:-1px; top:-1px; color:" &amp;amp; _ 
      GetHexCode(ForeColor) &amp;amp; "; width:100%;""&amp;gt;")
    RenderChildren(writer)
    writer.Write("&amp;lt;/span&amp;gt;")

    writer.Write("&amp;lt;/div&amp;gt;")
  End Sub

  Private Function GetHexCode(ByVal Color As System.Drawing.Color) As String
    Return "#" &amp;amp; Color.R.ToString("x2") &amp;amp; _
      Color.G.ToString("x2") &amp;amp; _
      Color.B.ToString("x2")
  End Function

  Public Sub New()
    'default colors
    Me.ForeColor = Drawing.Color.Black
    Me.BackColor = Drawing.Color.White
  End Sub
End Class&lt;/pre&gt;</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,a7b5a591-648c-4458-b785-08d4d9b6f9db.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=f16fee07-bcc3-4ec2-ba95-7aab6c361611</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,f16fee07-bcc3-4ec2-ba95-7aab6c361611.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,f16fee07-bcc3-4ec2-ba95-7aab6c361611.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f16fee07-bcc3-4ec2-ba95-7aab6c361611</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I kept running into the situation where
   a user's session would timeout and cause my web applications to work differently then
   they expected (for instance redirecting them to the login page instead of saving the
   form with changes they made and left up over night).  While it's temping to say,
   "well, yeah, that's how web applications work," but I've always thought
   there should be some simple solution that doesn't require explaining session timeouts
   to the user.<br /><br />
   I think I finally found one.  I call it session pinging.<br /><br />
   At first I thought about using <a href="http://en.wikipedia.org/wiki/AJAX">AJAX</a> (Asynchronous
   Javascript And Xml) to do this, but I wanted to make sure this worked for a wider
   selection of browsers.  Plus, I had to need to feedback from the server, so AJAX
   seemed like it might be too much overhead for the simple need I was trying to
   meet.  My solution began with a brilliant little AJAX alternative I found
   at <a href="http://www.dotvoid.com/view.php?id=13">dotvoid.com</a>.<br /><br /><pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px">function callServer(remoteScript) {
	try {
		var head = document.getElementsByTagName('head').item(0);
		var old  = document.getElementById('lastLoadedCmds');
		if (old) head.removeChild(old);
		script = document.createElement('script');
		script.src = remoteScript;
		script.type = 'text/javascript';
		script.defer = true;
		script.id = 'lastLoadedCmds';
		void(head.appendChild(script));
		return true;
	} catch (e) {
		//suppress
	}
	return true;
}

</pre>
   This ingenious function looks for a &lt;script&gt; tag in the header with and ID of
   lastLoadedCmds and removes it if it already exists. Then it adds a new &lt;script&gt;
   tag with the same ID and points it at a provided URL. This causes the browser to go
   to the URL behind-the-scenes to download it. If you specify a server-side script (ASP,
   ASPX, etc) instead of a static text file (.js, etc) you can run server-side, database-driven
   code without reloading the page. You can even have the callback page generate javascript
   code on-the-fly that will have some effect on the calling page (load a dropdown with
   values, put html into a place holder div, etc.). In other words, basically do similar
   things AJAX does.<br /><br />
   Now all we have to do in an ASP.NET application to keep session alive is
   have every page intermitently hit any .ASPX page on the server.  EvintermittentlyerytEvery
   timeime this happens the session-end time is pushed back another 20 minutes (or whatever
   timeout you've set).  This type of intermittent action can easily be done in
   JavaScript with the setInterval() method.<br /><br /><pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px">var pingTimer;

function setPingServer(timeout) {
	pingTimer = setInterval('callServer(\'/PingServer.aspx\');', timeout);
}

function killClock() {
	clearInterval(pingTimer);
}

</pre>
   Now just finish up by calling the setPingServer() method in the page's onload event.
   Make sure you clean up the interval you set when the user leaves the page. <pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px">&lt;body onload="setPingServer(30000)" onunload="killClock()"&gt;

</pre>
   This would also be a great solution to controlling the number of logged-in users for
   the purposes of licensing.  In that case, just change your PingServer.aspx page
   to log each distinct user somewhere so you can keep a count of distinct active users.</body>
      <title>ASP.NET Session Ping</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,f16fee07-bcc3-4ec2-ba95-7aab6c361611.aspx</guid>
      <link>http://www.jtower.com/blog/ASPNETSessionPing.aspx</link>
      <pubDate>Thu, 03 Nov 2005 16:42:39 GMT</pubDate>
      <description>I kept running into the situation where a user's session would timeout and cause my web applications to work differently then they expected (for instance redirecting them to the login page instead of saving the form with changes they made and left up over night).&amp;nbsp; While it's temping to say, "well, yeah, that's how&amp;nbsp;web applications&amp;nbsp;work," but&amp;nbsp;I've always thought there should be some simple solution that doesn't require explaining session timeouts to the user.&lt;br&gt;
&lt;br&gt;
I think I finally found one.&amp;nbsp; I call it session pinging.&lt;br&gt;
&lt;br&gt;
At first I thought about using &lt;a href="http://en.wikipedia.org/wiki/AJAX"&gt;AJAX&lt;/a&gt; (Asynchronous
Javascript And Xml) to do this, but I wanted to make sure this worked for a wider
selection of browsers.&amp;nbsp; Plus, I had to need to feedback from the server, so AJAX
seemed&amp;nbsp;like it might be too much overhead for the simple need I was trying to
meet.&amp;nbsp; My solution began with a brilliant little AJAX alternative&amp;nbsp;I found
at &lt;a href="http://www.dotvoid.com/view.php?id=13"&gt;dotvoid.com&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"&gt;function callServer(remoteScript) {
	try {
		var head = document.getElementsByTagName('head').item(0);
		var old  = document.getElementById('lastLoadedCmds');
		if (old) head.removeChild(old);
		script = document.createElement('script');
		script.src = remoteScript;
		script.type = 'text/javascript';
		script.defer = true;
		script.id = 'lastLoadedCmds';
		void(head.appendChild(script));
		return true;
	} catch (e) {
		//suppress
	}
	return true;
}

&lt;/pre&gt;
This ingenious function looks for a &amp;lt;script&amp;gt; tag in the header with and ID of
lastLoadedCmds and removes it if it already exists. Then it adds a new &amp;lt;script&amp;gt;
tag with the same ID and points it at a provided URL. This causes the browser to go
to the URL behind-the-scenes to download it. If you specify a server-side script (ASP,
ASPX, etc) instead of a static text file (.js, etc) you can run server-side, database-driven
code without reloading the page. You can even have the callback page generate javascript
code on-the-fly that will have some effect on the calling page (load a dropdown with
values, put html into a place holder div, etc.). In other words, basically&amp;nbsp;do&amp;nbsp;similar
things&amp;nbsp;AJAX does.&lt;br&gt;
&lt;br&gt;
Now all we have to do in an ASP.NET&amp;nbsp;application to keep&amp;nbsp;session alive is
have every page intermitently hit any .ASPX page on the server.&amp;nbsp; EvintermittentlyerytEvery
timeime this happens the session-end time is pushed back another 20 minutes (or whatever
timeout you've set).&amp;nbsp; This type of intermittent action can easily be done in
JavaScript with the setInterval() method.&lt;br&gt;
&lt;br&gt;
&lt;pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"&gt;var pingTimer;

function setPingServer(timeout) {
	pingTimer = setInterval('callServer(\'/PingServer.aspx\');', timeout);
}

function killClock() {
	clearInterval(pingTimer);
}

&lt;/pre&gt;
Now just finish up by calling the setPingServer() method in the page's onload event.
Make sure you clean up the interval you set when the user leaves the page. &lt;pre style="PADDING-RIGHT: 10px; PADDING-LEFT: 10px; BACKGROUND: #eeeeee; PADDING-BOTTOM: 10px; PADDING-TOP: 10px"&gt;&amp;lt;body onload="setPingServer(30000)" onunload="killClock()"&amp;gt;

&lt;/pre&gt;This would also be a great solution to controlling the number of logged-in users for the purposes of licensing.&amp;nbsp; In that case, just change your PingServer.aspx page to log each distinct user somewhere so you can keep a count of distinct active users.</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,f16fee07-bcc3-4ec2-ba95-7aab6c361611.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=3fa55547-03ca-44ee-825f-504311385568</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,3fa55547-03ca-44ee-825f-504311385568.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,3fa55547-03ca-44ee-825f-504311385568.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3fa55547-03ca-44ee-825f-504311385568</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">For all you business application developers
   out there, I've recently discovered the concept of Object Persistence Frameworks (OPF's)
   and <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">Object-Relational
   Mapping</a> (O/RM).  Basically, OPF's arose out of the fact that every business
   application is doing the same basic tasks: querying data from a database, persisting
   it temporarily in memory, displaying it to the user for viewing or editing, and persisting
   any user changes back to the database.  What if all these tasks could be encapsulated
   into a framework/object-model that would do these task for the programmer?  This
   persistence framework could do all the wiring-up and SQL building, and even handle
   null value replacement and record concurrency control.<br /><br />
   I've recently been using Gentle.NET, an open source OPF, on two different projects. 
   NHibernate is another open source one that's a .NET port of the JAVA OPF called Hibernate. 
   I spent a couple of weeks at work setting things up so using Gentle.NET would be easy
   and scalable.  In only took about one week of programming to make up that time. 
   In other words, I'd estimate that I was able to do about 3 weeks of programming
   in that 1 week!  Not bad.  
   <br /><br />
   Use it.  Just don't tell your boss how much extra time you'll have now. 
   ;)<br /><br />
   Find out more about <a href="http://sourceforge.net/projects/gopf">Gentle.NET</a>.</body>
      <title>When you've had enough "pushing data"</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,3fa55547-03ca-44ee-825f-504311385568.aspx</guid>
      <link>http://www.jtower.com/blog/WhenYouveHadEnoughPushingData.aspx</link>
      <pubDate>Sat, 29 Oct 2005 00:07:49 GMT</pubDate>
      <description>For all you business application developers out there, I've recently discovered the concept of Object Persistence Frameworks (OPF's) and &lt;a href="http://en.wikipedia.org/wiki/Object-relational_mapping"&gt;Object-Relational
Mapping&lt;/a&gt; (O/RM).&amp;nbsp; Basically, OPF's arose out of the fact that every business
application is doing the same basic tasks:&amp;nbsp;querying data from a database, persisting
it temporarily in memory, displaying it to the user for viewing or editing, and persisting
any user changes back to the database.&amp;nbsp; What if all these tasks could be encapsulated
into a framework/object-model that would do these task for the programmer?&amp;nbsp; This
persistence framework could do all the wiring-up and SQL building, and even handle
null value replacement and record concurrency control.&lt;br&gt;
&lt;br&gt;
I've recently been using Gentle.NET, an open source OPF, on two different projects.&amp;nbsp;
NHibernate is another open source one that's a .NET port of the JAVA OPF called Hibernate.&amp;nbsp;
I spent a couple of weeks at work setting things up so using Gentle.NET would be easy
and scalable.&amp;nbsp; In only took about one week of programming to make up that time.&amp;nbsp;
In other words, I'd estimate that I was able to do&amp;nbsp;about&amp;nbsp;3 weeks of programming
in that 1 week!&amp;nbsp; Not bad.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Use it.&amp;nbsp; Just don't tell your boss how much extra time you'll have now.&amp;nbsp;
;)&lt;br&gt;
&lt;br&gt;
Find out more about &lt;a href="http://sourceforge.net/projects/gopf"&gt;Gentle.NET&lt;/a&gt;.</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,3fa55547-03ca-44ee-825f-504311385568.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=f310ade2-b6a2-45c4-944c-ca3cd910d66d</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,f310ade2-b6a2-45c4-944c-ca3cd910d66d.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,f310ade2-b6a2-45c4-944c-ca3cd910d66d.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=f310ade2-b6a2-45c4-944c-ca3cd910d66d</wfw:commentRss>
      <slash:comments>23</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
      Web usability expert <a href="http://www.useit.com/" target="_blank">Jakob Nielsen's
      own site</a> gets worked over by a few designers in this <a href="http://www.designbyfire.com/000094.html" target="_blank">article</a>.
   </p>
      </body>
      <title>Design Eye for the Usability Guy</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,f310ade2-b6a2-45c4-944c-ca3cd910d66d.aspx</guid>
      <link>http://www.jtower.com/blog/DesignEyeForTheUsabilityGuy.aspx</link>
      <pubDate>Tue, 07 Jun 2005 17:28:18 GMT</pubDate>
      <description>&lt;p&gt;
   Web usability expert &lt;a href="http://www.useit.com/" target=_blank&gt;Jakob Nielsen's
   own site&lt;/a&gt; gets worked over by a few designers in this &lt;a href="http://www.designbyfire.com/000094.html" target=_blank&gt;article&lt;/a&gt;.
&lt;/p&gt;</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,f310ade2-b6a2-45c4-944c-ca3cd910d66d.aspx</comments>
      <category>Programming</category>
    </item>
    <item>
      <trackback:ping>http://www.jtower.com/blog/Trackback.aspx?guid=2e0e4c36-353f-43fe-97cc-8a10e79601bf</trackback:ping>
      <pingback:server>http://www.jtower.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.jtower.com/blog/PermaLink,guid,2e0e4c36-353f-43fe-97cc-8a10e79601bf.aspx</pingback:target>
      <dc:creator>
      </dc:creator>
      <wfw:comment>http://www.jtower.com/blog/CommentView,guid,2e0e4c36-353f-43fe-97cc-8a10e79601bf.aspx</wfw:comment>
      <wfw:commentRss>http://www.jtower.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2e0e4c36-353f-43fe-97cc-8a10e79601bf</wfw:commentRss>
      <slash:comments>27</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://programcsharp.com/blog/">Chris Hynes</a> has what I would consider
      "the complete solution" to the many issues related to uploading large files to
      an ASP.NET application.  Find out more in his krystalware <a href="http://krystalware.com/blog/">blog</a> or <a href="http://krystalware.com/wiki/default.aspx/KrystalWiki.SlickUpload">wiki</a>.
   </p>
      </body>
      <title>Uploading large files in ASP.NET</title>
      <guid>http://www.jtower.com/blog/PermaLink,guid,2e0e4c36-353f-43fe-97cc-8a10e79601bf.aspx</guid>
      <link>http://www.jtower.com/blog/UploadingLargeFilesInASPNET.aspx</link>
      <pubDate>Tue, 07 Jun 2005 17:22:19 GMT</pubDate>
      <description>&lt;p&gt;
   &lt;a href="http://programcsharp.com/blog/"&gt;Chris Hynes&lt;/a&gt; has what I would consider
   "the complete solution" to the&amp;nbsp;many issues related to uploading large files to
   an ASP.NET application.&amp;nbsp; Find out more in his krystalware &lt;a href="http://krystalware.com/blog/"&gt;blog&lt;/a&gt; or &lt;a href="http://krystalware.com/wiki/default.aspx/KrystalWiki.SlickUpload"&gt;wiki&lt;/a&gt;.
&lt;/p&gt;</description>
      <comments>http://www.jtower.com/blog/CommentView,guid,2e0e4c36-353f-43fe-97cc-8a10e79601bf.aspx</comments>
      <category>Programming</category>
    </item>
  </channel>
</rss>