<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Mike Harder's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/mharder/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/mharder/feed.xml</link>
    <description>ASP.NET and Random Programming Topics</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:41:29 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>WebParts and ASP.NET AJAX 1.0</title>
      <link>https://docs.microsoft.com/archive/blogs/mharder/webparts-and-asp-net-ajax-1-0</link>
      <pubDate>Tue, 23 Jan 2007 17:12:00 GMT</pubDate>
      <dc:creator><![CDATA[mharder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mharder/2007/01/23/webparts-and-asp-net-ajax-1-0/</guid>
      <description><![CDATA[A lot of people ask how to use WebParts with ASP.NET AJAX 1.0.&nbsp; There are three different...]]></description>
      <content:encoded><![CDATA[<P>A lot of people ask how to use <A class="" href="https://msdn2.microsoft.com/en-us/library/hhy9ewf1.aspx" target=_blank mce_href="https://msdn2.microsoft.com/en-us/library/hhy9ewf1.aspx">WebParts</A> with <A class="" href="https://ajax.asp.net/" target=_blank mce_href="https://ajax.asp.net/">ASP.NET AJAX 1.0</A>.&nbsp; There are three different WebParts features:</P>
<OL>
<LI>Cross-browser drag and drop. 
<LI>Modify WebParts page (drag and drop, minimize, restore, close, add, delete) without postback. 
<LI>Update contents of WebPart without postback.</LI></OL>
<P>Cross-browser drag and drop is enabled by using the WebParts controls in the AJAX&nbsp;Futures CTP.</P>
<P>Modifying a&nbsp;WebParts&nbsp;page without postback&nbsp;is implemented by wrapping the WebPartManager and WebPartZones in an UpdatePanel.&nbsp; This was partially working in the July CTP, but it <STRONG>does not work</STRONG> and is not supported in ASP.NET AJAX 1.0.&nbsp; It&nbsp;may be supported in Orcas.<BR><BR>Updating the contents of a WebPart without postback&nbsp;is implemented by placing an UpdatePanel inside a WebPart.&nbsp; This is supported in the core ASP.NET AJAX Extensions 1.0.&nbsp; It should work with either the ASP.NET 2.0 WebParts controls, or the AJAX Futures CTP versions of the WebParts controls.</P>
<P>Hope this helps.&nbsp; I've also posted this to the ASP.NET Forums: <A href="https://forums.asp.net/thread/1545256.aspx">https://forums.asp.net/thread/1545256.aspx</A>.</P>]]></content:encoded>
    </item>
    <item>
      <title>ASP.NET AJAX: ScriptControl change from Beta2 to RC - ScriptManager.RegisterScriptDescriptors()</title>
      <link>https://docs.microsoft.com/archive/blogs/mharder/asp-net-ajax-scriptcontrol-change-from-beta2-to-rc-scriptmanager-registerscriptdescriptors</link>
      <pubDate>Tue, 19 Dec 2006 19:42:00 GMT</pubDate>
      <dc:creator><![CDATA[mharder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mharder/2006/12/19/asp-net-ajax-scriptcontrol-change-from-beta2-to-rc-scriptmanager-registerscriptdescriptors/</guid>
      <description><![CDATA[There has been some confusion about a change&nbsp;made to ScriptControls&nbsp;between 
the ASP.NET...]]></description>
      <content:encoded><![CDATA[<p>There has been some confusion about a change&nbsp;made to ScriptControls&nbsp;between 
the <a href="https://ajax.asp.net" target="_blank" mce_href="https://ajax.asp.net">ASP.NET AJAX</a> Beta2 and RC.&nbsp; In Beta2, the only requirement for controls implementing 
IScriptControl or IExtenderControl was to call 
ScriptManager.RegisterScriptControl() or ScriptManager.RegisterExtenderControl() 
from their PreRender() method.&nbsp; In RC, there is an additional requirement to 
call ScriptManager.RegisterScriptDescriptors() from the Render() method.</p>
<p><b>Beta2<br></b><font color="#0000ff" size="2">public</font><font size="2"> </font><font color="#0000ff" size="2">class</font><font size="2"> </font><font color="#008080" size="2">MyScriptControl</font><font size="2"> : </font><font color="#008080" size="2">Control</font><font size="2">, </font><font color="#008080" size="2">IScriptControl</font><font size="2"> {<br>&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">protected</font><font size="2"> </font><font color="#0000ff" size="2">override</font><font size="2"> </font><font color="#0000ff" size="2">void</font><font size="2"> OnPreRender(</font><font color="#008080" size="2">EventArgs</font><font size="2"> e) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">base</font><font size="2">.OnPreRender(e);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#008080" size="2">ScriptManager</font><font size="2">.GetCurrent(Page).RegisterScriptControl(</font><font color="#0000ff" size="2">this</font><font size="2">);<br>&nbsp;&nbsp;&nbsp; }<br></font><font size="2">}</font></p>
<p><b>RC<br></b><font color="#0000ff">public</font><font size="2"> 
</font><font color="#0000ff" size="2">class</font><font size="2"> </font><font color="#008080" size="2">MyScriptControl</font><font size="2"> : </font><font color="#008080" size="2">Control</font><font size="2">, </font><font color="#008080" size="2">IScriptControl</font><font size="2"> {<br>&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">protected</font><font size="2"> </font><font color="#0000ff" size="2">override</font><font size="2"> </font><font color="#0000ff" size="2">void</font><font size="2"> OnPreRender(</font><font color="#008080" size="2">EventArgs</font><font size="2"> e) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">base</font><font size="2">.OnPreRender(e);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#008080" size="2">ScriptManager</font><font size="2">.GetCurrent(Page).RegisterScriptControl(</font><font color="#0000ff" size="2">this</font><font size="2">);<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">protected</font><font size="2"> </font><font color="#0000ff" size="2">override</font><font size="2"> </font><font color="#0000ff" size="2">void</font><font size="2"> Render(</font><font color="#008080" size="2">HtmlTextWriter</font><font size="2"> writer) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </font><font color="#0000ff" size="2">base</font><font size="2">.Render(writer);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
</font><font color="#008080" size="2">ScriptManager</font><font size="2">.GetCurrent(Page).RegisterScriptDescriptors(</font><font color="#0000ff" size="2">this</font><font size="2">);<br>&nbsp;&nbsp;&nbsp; }<br>}</font></p>
<p>In the RC, we added this to the ExtenderControl base class, so this change 
doesn't affect controls deriving from ExtenderControl.&nbsp; It only affects controls 
directly implementing IScriptControl and IExtenderControl.&nbsp; This change 
is&nbsp;mentioned&nbsp;several times&nbsp;in the <a href="https://ajax.asp.net/files/AspNet_AJAX_CTP_to_RC_Whitepaper.aspx" mce_href="https://ajax.asp.net/files/AspNet_AJAX_CTP_to_RC_Whitepaper.aspx" class="" target="_blank"><font color="#7395c1">ASP.NET AJAX CTP to RC 
whitepaper</font></a>&nbsp;(search for "RegisterScriptDescriptors").&nbsp; The rest of 
this post explains the rationale behind this change.</p>
<p>We needed to make this change&nbsp;because there are some scenarios where a 
control's PreRender() method is called but its Render() method is not.&nbsp; One 
example is a control inside a closed WebPart.&nbsp; In Beta2, ScriptControls did not 
work inside closed WebParts.&nbsp; The ScriptDescriptors would be registered, but the 
control would never render any HTML, which causes a JavaScript error when we try 
to find the associated HTML element.</p>
<p>To fix this issue, we needed to somehow verify that a ScriptControl was 
rendered before registering its ScriptDescriptors.&nbsp; Unfortunately, there is no 
way to externally determine whether a control has been rendered, so the only 
solution was to require the ScriptControl to call into the ScriptManager from 
its Render() method.&nbsp; We realize this extra call to RegisterScriptDescriptors() 
is annoying, but it was the only to fix the bug, and the&nbsp;change only affects 
controls directly implementing IScriptControl or IExtenderControl.&nbsp;&nbsp;As a result, 
we&nbsp;added the ScriptControl base class in RC, which makes it easier to write a 
basic ScriptControl without directly implementing the IScriptControl 
interface.</p>
<p>The new model is also more correct from a purist's standpoint.&nbsp; A control's 
script library is registered via&nbsp;its ScriptReferences, and it is safe to 
register these even if the control is never rendered.&nbsp; To maximize flexibility 
in rendering these script libraries, the ScriptReferences must be registered 
during the PreRender phase.&nbsp;&nbsp;A control's instance script is registered via its 
ScriptDescriptors, and it is not safe to register these if the control is never 
rendered.&nbsp; So, the instance script must be registered during the control's 
Render phase.</p>]]></content:encoded>
    </item>
    <item>
      <title>PDC 2005 Slides and Code</title>
      <link>https://docs.microsoft.com/archive/blogs/mharder/pdc-2005-slides-and-code</link>
      <pubDate>Mon, 11 Dec 2006 17:59:00 GMT</pubDate>
      <dc:creator><![CDATA[mharder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mharder/2006/12/11/pdc-2005-slides-and-code/</guid>
      <description><![CDATA[Back in September 2005 at PDC, I gave a talk with Andres Sanabria titled PRS418: Developing Portal...]]></description>
      <content:encoded><![CDATA[<p>Back in September 2005 at <a href="https://msdn.microsoft.com/events/pdc/" title="Microsoft PDC" mce_href="https://msdn.microsoft.com/events/pdc/">PDC</a>, I gave a talk with Andres Sanabria titled <b>PRS418: Developing Portal UI With Web Parts</b>.</p><p><br>There are five separate demos:</p><ol><li><b>ExternalWebParts: </b>The WebParts and Connections for a page are stored in an external XML file, instead of the page itself.&nbsp; Shows how to decouple the WebPart definitions from the page.&nbsp; Illustrates the different phases of the WebParts life cycle.</li><li><b>ContentManagement:</b> Customizes WebPart Personalization to implement a content management application.&nbsp; Multiple versions of the personalization data are stored for each page and loaded dynamically.&nbsp; Illustrates how to extend WebParts Personalization.</li><li><b>SecondaryIntefaces:</b> Uses the "SecondaryInterfaces" feature of WebParts connections to implement a basic interface yet provide richer data on a second interface.</li><li><b>SecureImportExport: </b>Uses a custom WebPartManager to encrypt the sensitive data in an exported .WebPart file.&nbsp; The data can not be view or modified by the end user, and can only be decrypted by the web server that encrypted it.&nbsp; Illustrates how to extend the import/export process.</li><li><b>WebPartsAdmin: </b>Allows management of Personalization data via an external page.&nbsp; Implemented by executing the target page in a child request.&nbsp; Illustrates how to modify the personalization data on another page.</li></ol>&nbsp; The slides and code are available <a href="https://blogs.msdn.com/mharder/attachment/1262342.ashx" title="PDC 2005 Slides and Code" mce_href="https://blogs.msdn.com/mharder/attachment/1262342.ashx">here</a>.
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/01/26/23/42/PRS418_Sanabria_Harder.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-01-26-23-42/PRS418_5F00_Sanabria_5F00_Harder.zip">PRS418_Sanabria_Harder.zip</a></p>]]></content:encoded>
    </item>
    <item>
      <title>ASP.NET Connections 2006 Slides and Code</title>
      <link>https://docs.microsoft.com/archive/blogs/mharder/asp-net-connections-2006-slides-and-code</link>
      <pubDate>Thu, 16 Nov 2006 17:59:00 GMT</pubDate>
      <dc:creator><![CDATA[mharder]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/mharder/2006/11/16/asp-net-connections-2006-slides-and-code/</guid>
      <description><![CDATA[Last week, I was in Las Vegas attending the ASP.NET Connections 2006 conference.&nbsp; I gave a talk...]]></description>
      <content:encoded><![CDATA[Last week, I was in Las Vegas attending the <a href="https://www.devconnections.com/shows/aspfall2006/default.asp?s=82" title="ASP.NET Connections 2006" mce_href="https://www.devconnections.com/shows/aspfall2006/default.asp?s=82">ASP.NET Connections 2006</a> conference.&nbsp; I gave a talk with Mir Tariq titled <b>AMS306:&nbsp;Developing Rich Web Applications with ASP.NET “Atlas”.&nbsp;</b>The slides and code are available <a href="https://blogs.msdn.com/mharder/attachment/1089411.ashx" title="AMS306 Developing Rich Web Applications with ASP.NET AJAX" mce_href="https://blogs.msdn.com/mharder/attachment/1089411.ashx">here</a>.<br>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/01/08/94/11/AMS306_Harder_Tariq.zip" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-01-08-94-11/AMS306_5F00_Harder_5F00_Tariq.zip">AMS306_Harder_Tariq.zip</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>