<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Joe Wrobel </title><link>http://weblogs.asp.net/joewrobel/default.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Web Profile Builder 1.3</title><link>http://weblogs.asp.net/joewrobel/archive/2008/05/04/web-profile-builder-1-3.aspx</link><pubDate>Mon, 05 May 2008 05:33:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6158303</guid><dc:creator>robolize</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=6158303</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/05/04/web-profile-builder-1-3.aspx#comments</comments><description>&lt;FONT face=Calibri size=3&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;I released a new build of Web Profile Builder.&lt;BR&gt;Not much has changed for the 1.3 release.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;The focus of this release was to revert an undesirable change I made for version 1.2.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I did however add one new feature so I changed the version to 1.3.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;What was the new feature added?&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;I changed the generated profile class to be a partial class.&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/SPAN&gt;Now you can easily add any custom code to the profile class (in a separate code file) without losing your changes when the profile class gets regenerated.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Files can be downloaded from the MSDN Code Gallery &lt;A class="" title=here href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=WebProfileBuilder&amp;amp;ReleaseId=980" target=_blank mce_href="https://code.msdn.microsoft.com/Release/ProjectReleases.aspx?ProjectName=WebProfileBuilder&amp;amp;ReleaseId=980"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;Thanks&lt;BR&gt;-Joe&lt;/P&gt;&lt;/FONT&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6158303" width="1" height="1"&gt;</description></item><item><title>Web Profile Builder 1.2.0.0 Released</title><link>http://weblogs.asp.net/joewrobel/archive/2008/04/16/web-profile-builder-1-2-0-0-released.aspx</link><pubDate>Thu, 17 Apr 2008 04:16:03 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:6104723</guid><dc:creator>robolize</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=6104723</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/04/16/web-profile-builder-1-2-0-0-released.aspx#comments</comments><description>&lt;p&gt;Files can be downloaded from the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/a&gt; project page.    &lt;br /&gt;If you are unfamiliar with Web Profile Builder, you can read my initial blog post about it &lt;a href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx" target="_blank" mce_href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx"&gt;here&lt;/a&gt;.    &lt;br /&gt;Details of this release can be found on the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder/Release/ProjectReleases.aspx?ReleaseId=918" target="_blank"&gt;Code Gallery web site&lt;/a&gt;.    &lt;br /&gt;I had a little time to put together some basic documentation.&amp;#160; It is available from the &lt;a href="http://code.msdn.microsoft.com/WebProfileBuilder/Release/ProjectReleases.aspx?ReleaseId=918" target="_blank"&gt;release download&lt;/a&gt; section.&lt;/p&gt;  &lt;p&gt;Thanks   &lt;br /&gt;-Joe&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6104723" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx">Profile</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx">WAP</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx">Web Application Project</category></item><item><title>Web Profile Builder 1.1.0.0 Released</title><link>http://weblogs.asp.net/joewrobel/archive/2008/03/17/web-profile-builder-1-1-0-0-released.aspx</link><pubDate>Mon, 17 Mar 2008 06:00:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5981513</guid><dc:creator>robolize</dc:creator><slash:comments>5</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=5981513</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/03/17/web-profile-builder-1-1-0-0-released.aspx#comments</comments><description>&lt;P&gt;Files can be downloaded from the &lt;A href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/A&gt; project page.&lt;/P&gt;
&lt;P&gt;If you are unfamiliar with Web Profile Builder, you can read my initial blog post about it &lt;A href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx" target=_blank mce_href="http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx"&gt;here&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Changes made for release 1.1.0.0:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Added the ability to detect changes made to the profile section of the web.config file &lt;BR&gt;and only rebuild the Profile class if changes have been made.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Notes:&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;If you used the previous release, remember to uninstall it first.&lt;/LI&gt;
&lt;LI&gt;Also, if you used the previous release and added the customize section in the &lt;BR&gt;web.config file, remember to update the assembly reference to &lt;BR&gt;“WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=1.1.0.0, &lt;BR&gt;Culture=neutral, PublicKeyToken=01d50f1f82943b0c”.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;Thank you to everybody who provided me with valuable feedback.&amp;nbsp; This release should address &lt;BR&gt;all of your concerns.&lt;/P&gt;
&lt;P&gt;Thanks &lt;BR&gt;-Joe&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5981513" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx">Profile</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx">WAP</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx">Web Application Project</category></item><item><title>ClientID Problem In External JavaScript Files Solved</title><link>http://weblogs.asp.net/joewrobel/archive/2008/02/19/clientid-problem-in-external-javascript-files-solved.aspx</link><pubDate>Wed, 20 Feb 2008 06:18:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5826121</guid><dc:creator>robolize</dc:creator><slash:comments>1</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=5826121</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/02/19/clientid-problem-in-external-javascript-files-solved.aspx#comments</comments><description>&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Well, at least for me it is.&amp;nbsp; I say that because this solution might &lt;BR&gt;not appeal to the masses, but it works great for me.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The binary and source files can be downloaded from the MSDN Code Gallery. &lt;BR&gt;Here is the direct link. &lt;BR&gt;&lt;A title=http://code.msdn.microsoft.com/RegClientControls href="http://code.msdn.microsoft.com/RegClientControls" mce_href="http://code.msdn.microsoft.com/RegClientControls"&gt;http://code.msdn.microsoft.com/RegClientControls&lt;/A&gt; &lt;BR&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Up until lately, I have been writing my JavaScript in the .aspx file. &lt;BR&gt;That way I could use the ClientID trick.&amp;nbsp; &lt;STRONG&gt;&amp;lt;%=TextBox1.ClientID%&amp;gt;&lt;/STRONG&gt; &lt;BR&gt;I just began working with a team who prefers to write all JavaScript in &lt;BR&gt;external .js files.&amp;nbsp; What they had been doing is hard coding the &lt;BR&gt;ClientID prefixes caused by the container controls.&amp;nbsp; I guess this works &lt;BR&gt;fine.&amp;nbsp; It has been working for them so far.&amp;nbsp; I personally can't do this. &lt;BR&gt;It just feels wrong.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;I took some time to figure out a better way to deal with the ClientID in &lt;BR&gt;an external JavaScript file.&amp;nbsp; I found an interesting article &lt;/FONT&gt;&lt;A href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects" target=_blank mce_href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects"&gt;&lt;FONT face="Courier New" size=2&gt;here&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" size=2&gt; about &lt;BR&gt;&lt;/FONT&gt;&lt;A href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects" target=_blank mce_href="http://www.netfxharmonics.com/2007/09/Creating-JavaScript-objects-from-ASPNET-objects"&gt;&lt;FONT face="Courier New" size=2&gt;Creating JavaScript objects from ASP.NET objects&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face="Courier New" size=2&gt;.&amp;nbsp; I liked David's technique, &lt;BR&gt;but it still required manually writing JavaScript on the .aspx page. I wrote &lt;BR&gt;a control called "RegClient" that encapsulates and automates this technique. &lt;BR&gt;If you place this control on your page anywhere below the Script Manager, &lt;BR&gt;then all you have to do to access the controls from JavaScript is something &lt;BR&gt;like "&lt;STRONG&gt;&lt;FONT color=#0000ff&gt;var&lt;/FONT&gt; controlObj = PageControls.TextBox1;&lt;/STRONG&gt;".&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The RegClient control is dependant on Microsoft ASP.NET AJAX 1.0.&amp;nbsp; The &lt;BR&gt;source could easily be targeted to .NET 3.5 if you wanted.&amp;nbsp; I'm sure &lt;BR&gt;that with a little work it could even be library independent, but I &lt;BR&gt;didn't have that requirement.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;The RegClient control has two modes, "Marked" and "All".&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;FONT face="Courier New"&gt;&lt;FONT color=#000000&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;Marked:&lt;/FONT&gt;&lt;/STRONG&gt; &lt;BR&gt;With the RegClient control set to Marked, only the controls marked with &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;RegClient="true" or ClientControlID="{yourClientName}" will be registered.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=598&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Robo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RegClient&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="RegClient1"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;runat&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="server"&lt;/SPAN&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: red"&gt;ClientControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="Marked"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&lt;STRONG&gt;&lt;FONT size=3&gt;All:&lt;/FONT&gt;&lt;/STRONG&gt; &lt;BR&gt;With the RegClient control set to All, every control in master &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;and content pages will &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;be registered unless RegClient="&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;false".&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=600&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;Robo&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;:&lt;/SPAN&gt;&lt;SPAN style="COLOR: #a31515"&gt;RegClient&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;ID&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="RegClient1"&lt;/SPAN&gt; &lt;SPAN style="COLOR: red"&gt;runat&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="server" &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: red"&gt;ClientControls&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;="All"&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN-BOTTOM: 0pt; LINE-HEIGHT: normal; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face="Courier New" size=2&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;H6&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;To access the controls in the external JavaScript file, handle &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;the &lt;BR&gt;"ready" event of &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;the "PageControls" object like shown here.&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/H6&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=598&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.add_ready(&lt;SPAN style="COLOR: blue"&gt;function&lt;/SPAN&gt;(){ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;SPAN style="COLOR: green"&gt;//Write your code here. &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;});&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;All of the controls that have been registered will be available from &lt;BR&gt;the "PageControls" object in JavaScript.&amp;nbsp; Here is an example of accessing &lt;BR&gt;the controls. &lt;BR&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;TABLE class="" cellSpacing=0 cellPadding=2 width=600 border=1&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD class="" vAlign=top width=600&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.add_ready(&lt;SPAN style="COLOR: blue"&gt;function&lt;/SPAN&gt;(){&amp;nbsp; &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $addHandler($get(&lt;SPAN style="COLOR: #a31515"&gt;'Button2'&lt;/SPAN&gt;), &lt;SPAN style="COLOR: #a31515"&gt;'click'&lt;/SPAN&gt;,&amp;nbsp; &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; function&lt;/SPAN&gt;() {&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;PageControls.Label1.innerHTML = PageControls.tbText.value;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;&lt;FONT face="Courier New"&gt;}&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;FONT face="Courier New"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;);&amp;nbsp; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " courier="courier" new?;="new?;" mso-no-proof:="mso-no-proof:" yes?="yes?"&gt;});&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#ff0000&gt;One caution I would make for using this control is to be careful when you &lt;BR&gt;have the ClientControls setting to "All".&amp;nbsp; This control will find and &lt;BR&gt;register every control that derives from WebControl.&amp;nbsp; If you're using &lt;BR&gt;a GridView or something similar on the page, then there could be many &lt;BR&gt;extra controls that you don't want to get registered.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT color=#000000&gt;Here is a screen shot of the RegClient control.&amp;nbsp; There really is only one &lt;BR&gt;setting for this control, but I added a big blob of text as a reminder of &lt;BR&gt;how to use it with other controls.&lt;/FONT&gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=575 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb.png" width=513 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" color=#000000 size=2&gt;When the page renders, this is what the generated output looks like at &lt;BR&gt;at the bottom of the page.&lt;/FONT&gt; &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_4.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_4.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=195 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb_1.png" width=579 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/ClientIDProblemInExternalJavaScriptFiles_740E/image_thumb_1.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;So, that's it.&amp;nbsp; I hope you find this useful and if you know of any ways &lt;BR&gt;this control could be improved, please let me know.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size=2&gt;Thanks &lt;BR&gt;-Joe&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5826121" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ClientID/default.aspx">ClientID</category></item><item><title>Web Profile Builder for Web Application Projects</title><link>http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx</link><pubDate>Sun, 03 Feb 2008 10:21:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5699163</guid><dc:creator>robolize</dc:creator><slash:comments>30</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=5699163</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/02/03/web-profile-builder-for-web-application-projects.aspx#comments</comments><description>&lt;P&gt;Files can be downloaded from the &lt;A class="" href="http://code.msdn.microsoft.com/WebProfileBuilder" target=_blank mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;Web Profile Builder&lt;/A&gt; project page.&lt;/P&gt;
&lt;P&gt;If you use Web Application Projects, you have probably run into the issue of not being &lt;BR&gt;able to access the Profile at design time.&lt;/P&gt;
&lt;P&gt;Thankfully, some nice people created an Add-In for Visual Studio 2005 that will generate &lt;BR&gt;a wrapper class as a workaround.&amp;nbsp; That project can be found &lt;A href="http://www.codeplex.com/WebProfile" target=_blank mce_href="http://www.codeplex.com/WebProfile"&gt;here&lt;/A&gt;.&amp;nbsp; I wanted to contribute &lt;BR&gt;to the &lt;A href="http://www.codeplex.com/WebProfile" target=_blank mce_href="http://www.codeplex.com/WebProfile"&gt;Web Profile Generator&lt;/A&gt; project, but my emails went unanswered.&amp;nbsp; I decided to start &lt;BR&gt;a new project.&lt;/P&gt;
&lt;P&gt;This project picks up where that one left off and is based on their source code.&amp;nbsp; I started &lt;BR&gt;out rebuilding that project as it stood to add support for Visual Studio 2008.&amp;nbsp; I got it to &lt;BR&gt;work, but I wanted to do more.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I decided to go ahead and address the issues listed on the original &lt;A href="http://www.codeplex.com/WebProfile/WorkItem/List.aspx" target=_blank mce_href="http://www.codeplex.com/WebProfile/WorkItem/List.aspx"&gt;project site&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Here is a summary of the changes made.&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;First of all, this is no longer an Add-In.&amp;nbsp; Instead, it is a Build Task.&lt;/LI&gt;
&lt;LI&gt;Works for Visual Studio 2005 and 2008.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the file name.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the directory the file gets created in.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the class name.&lt;/LI&gt;
&lt;LI&gt;Added ability to set the name space.&lt;/LI&gt;
&lt;LI&gt;Added an extra method as requested &lt;A href="http://www.codeplex.com/WebProfile/Thread/View.aspx?ThreadId=20291" target=_blank mce_href="http://www.codeplex.com/WebProfile/Thread/View.aspx?ThreadId=20291"&gt;here&lt;/A&gt;.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Usage:&lt;/STRONG&gt;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Run the installer.&lt;/LI&gt;
&lt;LI&gt;Add this Import statement to your project file.&amp;nbsp; (see special notes below) &lt;BR&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;Import&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;Project&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;$(MSBuildExtensionsPath)\WebProfileBuilder\WebProfileBuilder.targets&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;Done.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;The profile will get generated every time you build the project.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;STRONG&gt;Special Notes:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;After you modify the project file by adding the import statement, you will get this security &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;warning when the project loads.&amp;nbsp; Choose the "Load project normally" option and press OK. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=440 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_thumb.png" width=655 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/WebProfileBuilderforWebApplicationProjec_1891/image_thumb.png"&gt;&lt;/A&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;STRONG&gt;Extended Usage:&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;If you want to customize the web profile, you can add the following sections to your web.config.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;This section needs to be at the top of the file just under the opening configuration tag. &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;configSections&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;sectionGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;robo.webProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;section&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;name&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;webProfileSettings&lt;/SPAN&gt;"&lt;FONT color=#0000ff&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;type&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;WebProfileBuilder.WebProfileConfigurationSection, WebProfileBuilder, Version=1.0.0.0, Culture=neutral, PublicKeyToken=01d50f1f82943b0c&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;allowLocation&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;true&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;allowDefinition&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;Everywhere&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;/&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;sectionGroup&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;configSections&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;This section can be anywhere under the configuration section. &lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;robo.webProfile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;webProfileSettings&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt; &lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;className&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;=&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;"&lt;SPAN style="COLOR: blue"&gt;MyWebProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: red"&gt;nameSpace&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CustomNameSpace&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&lt;SPAN style="COLOR: red"&gt;directory&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;CodeFiles&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: red"&gt;fileName&lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;=&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt;MyWebProfile&lt;/SPAN&gt;"&lt;SPAN style="COLOR: blue"&gt; /&amp;gt; &lt;BR&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: #a31515; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;robo.webProfile&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 115%; FONT-FAMILY: " yes? mso-no-proof: new?; courier&gt;&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;The directory name is not a virtual directory, but is in reference to the root of the Web Application. &lt;BR&gt;The fileName is just the name of the file and should not include an extension. &lt;BR&gt;The className and nameSpace are as you would expect. &lt;BR&gt;None of these settings are required.&amp;nbsp; You don't even need to define this section at all.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;If you would like to use Web Profile Builder, it can be downloaded &lt;A href="http://code.msdn.microsoft.com/WebProfileBuilder" mce_href="http://code.msdn.microsoft.com/WebProfileBuilder"&gt;here&lt;/A&gt;. &lt;BR&gt;Also available is the complete source code and examples in VB and C#.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="COLOR: blue"&gt;&lt;FONT face=Arial color=#000000&gt;Thanks &lt;BR&gt;-Joe&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5699163" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Profile/default.aspx">Profile</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/WAP/default.aspx">WAP</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/Web+Application+Project/default.aspx">Web Application Project</category></item><item><title>A more elegant solution to display GridView header and footer when the data source is empty.</title><link>http://weblogs.asp.net/joewrobel/archive/2008/01/30/a-more-elegant-solution-to-display-gridview-header-and-footer-when-the-data-source-is-empty.aspx</link><pubDate>Thu, 31 Jan 2008 00:47:00 GMT</pubDate><guid isPermaLink="false">c06e2b9d-981a-45b4-a55f-ab0d8bbfdc1c:5678649</guid><dc:creator>robolize</dc:creator><slash:comments>6</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://weblogs.asp.net/joewrobel/rsscomments.aspx?PostID=5678649</wfw:commentRss><comments>http://weblogs.asp.net/joewrobel/archive/2008/01/30/a-more-elegant-solution-to-display-gridview-header-and-footer-when-the-data-source-is-empty.aspx#comments</comments><description>&lt;P&gt;I think the need to always show the header and footer of a GridView is pretty common. &lt;BR&gt;When I first ran into this problem, I went to Google and found lots of content about this. &lt;BR&gt;Some suggest tampering with the data source to add an extra row if it’s empty.&amp;nbsp; &lt;BR&gt;Others show overriding the CreateChildControls method.&lt;/P&gt;
&lt;P&gt;I was not satisfied with either of these solutions. I didn’t like that dirty feeling I had by tampering &lt;BR&gt;with the data source.&amp;nbsp; And I didn’t like overriding the CreateChildControls method because it &lt;BR&gt;simply didn’t work of me anyway.&amp;nbsp; This solution only gave the appearance of the header and &lt;BR&gt;footer existing.&amp;nbsp; I ran into issues because I was programmatically adding controls to the header.&amp;nbsp; &lt;BR&gt;Upon postback, if the data source was empty, the control hierarchy would not be the same as &lt;BR&gt;before thus causing an error.&lt;/P&gt;
&lt;P&gt;So here is my solution.&amp;nbsp; I'll cover the main points of interest and if you want to see more, I have &lt;BR&gt;uploaded all the source and example to the new MSDN Code Gallery. &lt;BR&gt;&lt;A title=http://code.msdn.microsoft.com/AlwaysShowHeaderFoot href="http://code.msdn.microsoft.com/AlwaysShowHeaderFoot" mce_href="http://code.msdn.microsoft.com/AlwaysShowHeaderFoot"&gt;http://code.msdn.microsoft.com/AlwaysShowHeaderFoot&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Start out by extending the GridView control and add the following structure.&amp;nbsp; &lt;BR&gt;The most important part here is to override the PerformDataBinding method. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_2.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_2.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=458 alt=ClassStructure src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_thumb.png" width=677 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/ClassStructure_thumb.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;As you can see here.&amp;nbsp; I am intercepting the data and making sure there is at lease one row.&amp;nbsp; &lt;BR&gt;If there is, the control behaves normally. &lt;BR&gt;On the line with the red arrow, I am checking if the binding source is a DataView.&amp;nbsp; &lt;BR&gt;If it is, I can just add a row here and be done with it. &lt;BR&gt;If the binding source is not a DataView (or DataSet), then I fire an event that will need to be handled. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_14.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_14.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=678 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_6.png" width=720 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_6.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The event "MustAddARow", as seen here, will provide access to the binding data and allow you to add a row. &lt;BR&gt;&amp;nbsp;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_16.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_16.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=195 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_7.png" width=730 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_7.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;Here is a snippet from a page where I handle the MustAddARow event. &lt;BR&gt;In this case, I am binding a List of Products to the GridView. &lt;BR&gt;As you can see, I'm just adding a new Product to the list.&amp;nbsp; It doesn't matter what data you add here &lt;BR&gt;because it will get hidden in back in the GridView. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_10.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_10.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=165 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_4.png" width=600 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_4.png"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;And finally back in the GridView, I override the OnDataBound method so I can hide that extra row. &lt;BR&gt;&lt;A href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_18.png" mce_href="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_18.png"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=276 alt=image src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_8.png" width=658 border=0 mce_src="http://weblogs.asp.net/blogs/joewrobel/WindowsLiveWriter/AmoreelegantsolutiontodisplayGridViewhe_E5CF/image_thumb_8.png"&gt;&lt;/A&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;So there you have it.&amp;nbsp; This is my first blog post ever.&amp;nbsp;&lt;BR&gt;Hopefully someone will get some use out of this. &lt;/P&gt;
&lt;P&gt;Thanks &lt;BR&gt;-Joe&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=5678649" width="1" height="1"&gt;</description><category domain="http://weblogs.asp.net/joewrobel/archive/tags/GridView/default.aspx">GridView</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/ASP.NET/default.aspx">ASP.NET</category><category domain="http://weblogs.asp.net/joewrobel/archive/tags/C_2300_/default.aspx">C#</category></item></channel></rss>