<?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:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" version="2.0">
  <channel>
    <title>Brian Mishler on .Net</title>
    <link>http://mishler.net/</link>
    <description />
    <language>en-us</language>
    <copyright>Brian Mishler</copyright>
    <lastBuildDate>Sun, 04 Feb 2007 03:51:37 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>bmishler@qualitydata.com</managingEditor>
    <webMaster>bmishler@qualitydata.com</webMaster>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <title>How to implement a Custom Provider in a WinForms Application</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</guid>
      <link>http://mishler.net/2007/02/04/HowToImplementACustomProviderInAWinFormsApplication.aspx</link>
      <pubDate>Sun, 04 Feb 2007 03:51:37 GMT</pubDate>
      <description>&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Since we always see the “Provider Model”
used in the context of Asp.Net applications (Membership Provider, Roles Provider,
Etc.) we often think of this as something that is available only in the Asp.Net world.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;It
was recently mentioned to me that there are no good source code examples for custom
providers in the Winforms space and that the Asp.Net examples utilize the System.Web.Configuration.ProvidersHelper
class to instantiate the provider.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;While there are several other blogs that
talk about bits and pieces of this subject, I thought I might create a start-to-finish
Windows Forms Application that illustrates how one can effectively use the provider
model.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;I wrote the solution in Vb.Net
and have included it in the attached zip file.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Advance disclaimer: When I started into
this, I thought to myself “of course you can do this without any of the System.Web
classes” and, in fact, you totally can with just a little bit more work than I put
into this. I cheated a bit by dropping in a reference to System.Web in order to gain
access to System.Web.Configuration.ProvidersHelper to deserialize my provider elements,
but this is only because I am lazy and was copying code from another project. That
class is doing nothing fancier than standard deserialization of XML into an instance
of a class.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Besides: Who says you can’t
reference System.web from a Winforms app?&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;So, consider this scenario:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;blockquote dir=ltr style="MARGIN-RIGHT: 0px"&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;You develop a Winforms Application and
have some standard functionality, business rules, etc. For example, your application
calls a method that returns a standard report. Knowing that down the road, each one
of your customers is going to want to change the way that report works, you decide
to build the reporting class using the provider model.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;This
way, you can later build a custom DLL that implements the same interface as the reporting
class (but with unique functionality) and can be installed by simply copying the DLL
to the application folder and then making a change to the application configuration
file (myapp.exe.config.)&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Every customer
can get his/her own unique reporting DLL and the main application never needs to be
modified.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;&lt;strong&gt;In a nutshell, this is how you
do it for an existing class:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 1: Create a base “mustInherit” class
which has the methods (but no code implementation) of your current class. In the COM
world, this is analogous to an Interface.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Now,
modify your class to inherit from this new base class.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 2: Create classes that will be used
to deserialize information in your app.exe.config.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;These
will derive from classes in the System.Configuration namespace and will include one
for your configuration section, one for a collection of provider settings and one
for the provider settings itself.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Doing
this will result in a strongly typed system for referring to your list of configured
providers and their respective settings at runtime.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face="Courier New"&gt;Step 3: Modify your main application
so that rather than instantiating that existing class as you might have done before,
you instead ask the configuration manager to use the information in yourapp.exe.config
to load up your custom section and give you back an instance of the provider which
has been dubbed as “the one to use.”&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face="Courier New" color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;font color=#000000&gt;&lt;font face=Calibri size=3&gt;&lt;font face="Courier New" size=2&gt;To illustrate
this process, I have whipped up a very simple base provider “MyProviderBase” that
exposes a single method:&lt;/font&gt; “&lt;/font&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;GetProviderSpecificMessage()”.
I then have two separate implementations: “MyFirstProvider” and “MySecondProvider”,
each of which handles GetProviderSpecificMessage() in its own way.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;(While
all of this is pretty basic stuff, the interesting part is where you enable selective
usage of one or the other implementations through settings in the configuration file.)
A tiny winform application, consisting of a button on a form does nothing more than
load the appropriate provider and call its “GetProviderSpecificMessage” method.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/font&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;With
the configuration file set up to use the first provider, the output is as shown in
the following message box. (Notice that defaultProvider=”MyFirstProvider” in the application
configuration file shown below.) 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /&gt;
&lt;v:shapetype id=_x0000_t75 stroked="f" filled="f" path="m@4@5l@4@11@9@11@9@5xe" o:preferrelative="t" o:spt="75" coordsize="21600,21600"&gt;
&lt;v:stroke joinstyle="miter"&gt;&lt;/v:stroke&gt;
&lt;v:formulas&gt;
&lt;v:f eqn="if lineDrawn pixelLineWidth 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 1 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum 0 0 @1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @2 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @3 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @0 0 1"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @6 1 2"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelWidth"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @8 21600 0"&gt;&lt;/v:f&gt;
&lt;v:f eqn="prod @7 21600 pixelHeight"&gt;&lt;/v:f&gt;
&lt;v:f eqn="sum @10 21600 0"&gt;&lt;/v:f&gt;
&lt;/v:formulas&gt;
&lt;v:path o:connecttype="rect" gradientshapeok="t" o:extrusionok="f"&gt;&lt;/v:path&gt;
&lt;o:lock aspectratio="t" v:ext="edit"&gt;&lt;/o:lock&gt;
&lt;/v:shapetype&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider1.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;em&gt;Big
note: In your solution, the file called app.config will be deployed as yourapplicationname.exe.config
when you build.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;When you distribute the
application, just drop this config file into the same folder as the exe.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Now,
do nothing more than change the configuration file to set defaultProvider=”MySecondProvider”
and you get a totally different result when you run the program.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider2.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;For
a top-down look at the implementation, I will first talk about the winForm app (which
I wrote last) and then about the provider implementation.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;As
you can see, the solution is very basic.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&lt;img src="http://mishler.net/content/binary/WinProvider3.jpg" border=0&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
WinForm Application:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Start
a new Winform project and drop in a button control. In the button’s click event, get
the implemented provider, call its GetProviderSpecificMessage method, and display
its result in a MessageBox.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Here is the
code:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; QualityData&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Web.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; Form1&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Button1_Click(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; sender &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Object, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; e &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.EventArgs) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt;&lt;font color=#000000&gt; Button1.Click&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase
= GetProvider()&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(provider) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; MsgBox(provider.GetProviderSpecificMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProvider() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get reference to configuration section for our provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; section &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderSection
= &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(ConfigurationManager.GetSection(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"myProvider"&lt;/span&gt;&lt;font color=#000000&gt;),
MyProviderSection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(section) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
load registered providers and get reference to default provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; providers &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; MyProviderCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&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;System.Web.Configuration.ProvidersHelper.InstantiateProviders(section.Providers,
providers, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;GetType&lt;/span&gt;&lt;font color=#000000&gt;(MyProviderBase))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(providers(section.DefaultProvider),
MyProviderBase)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Else&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;em&gt;Another
big note: This is the place where I used the shared ProvidersHelper.InstantiateProviders
method in the System.Web.Configuration namespace to walk through my section and instantiate
each of the listed providers. I don’t know why Microsoft did not put the ProvidersHelper
class into the System.Configuration assembly but it is really not such a big deal
to have to get to it in System.Web. &lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&lt;/span&gt;If
I get around to it, I might go for extra credit and write my own InstantiateProviders
method by enumerating the elements and instantiating each provider based on its type.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/em&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
Application .config file&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Here
is the application’s config file (mine is called WinformProviderSample.exe.config.)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;?&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;xml&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;version&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;1.0&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;encoding&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;utf-8&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; ?&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configuration&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; ConfigSections
section MUST be first section in app.config &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configSections&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;section&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;myProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; &lt;/span&gt;&lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;=&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MyProviderSection,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configSections&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; This
is the custom provider section which gets loaded into the QualityData.MyProviderSection
Class &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;myProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;defaultProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MySecondProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="COLOR: green"&gt; Change
this to swap providers &lt;/span&gt;&lt;span style="COLOR: blue"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;providers&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;clear&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;/&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;!--&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Here
are one or more providers, each defined by its type "Class Name, DLL Name" 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;and
each with settings.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Within the class,
MyProviderSection, these get loaded into&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;and
are accessed by "Providers" property &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;--&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;add&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MyFirstProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&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; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MyFirstProvider,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&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; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheCustomSetting&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;This
is the first provider setting value in app.config&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;add&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;name&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;MySecondProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&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; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;type&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;QualityData.MySecondProvider,MyProvider&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&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; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheCustomSetting&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;This
is the second provider's setting value in app.config&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&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; COLOR: red; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;TheExtraMessage&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt;..And
here is some extra information to configure the second provider!!!!&lt;/span&gt;&lt;font color=#000000&gt;"&lt;/font&gt;&lt;span style="COLOR: blue"&gt; /&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;providers&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;myProvider&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;configuration&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Notice
that I have listed two providers: MyFirstProvider and MySecondProvider. As illustrated,
the configuration file is set up to use the second.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Each
of the provider elements has a name as well as a type attribute. The latter is structured
as “ClassName,Assembly” where “ClassName” (QualityData.MyFirstProvider) is the fully
qualified class name including the namespace and “Assembly” is the name of the assembly
(MyProvider.dll) without the “.dll”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;You
can tell that both classes are contained in the same assembly in this example.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Notice
also that each provider section can have its own set of attributes. In “MySecondProvider”,
for example, the attribute “TheExtraMessage” is optionally used to pass in extra configuration
information that may be used by this particular implementation.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Hopefully
you will agree that this is a fairly convenient and simple deployment story.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;strong&gt;The
Provider Classes&lt;/strong&gt;&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Now
let’s talk about the provider. The project: MyProvider consists of several classes
which I put into a single file for brevity.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;Here
is the code in its entirety:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; System.Configuration&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Imports&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; system.Configuration.Provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;Namespace&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; QualityData&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This is the base class that defines the required methods of any implementation&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;MustInherit&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
For simplicity, we will have a single method that gets implemented 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
differently based on the chosen provider.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;MustOverride&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
The following two classes are "providers" that implement the base in different ways&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Ordinarily, each of these two classes would be in its own DLL since much of the idea
of the&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
Provider model is to be able to ship new behavior that can be "dropped in" without
replacing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
the rest of the application&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; myFirstProvider
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Initialize(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; config &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Collections.Specialized.NameValueCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
Override the method of Configuration.Provider.ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
default provider name if missing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(name) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; name
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MyFirstProvider"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
initialize base and get custom settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(config) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Initialize(name,
config)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get the setting from config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&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; &lt;/span&gt;_myUniqueMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheCustomSetting"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
default setting to something uniquely from this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_myUniqueMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage&amp;nbsp;=&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;&amp;nbsp;"FIRST
PROVIDER WAS HERE!!"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
return string that has provider-specific prefix as well as data from config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"The
First Provider says: "&lt;/span&gt;&lt;font color=#000000&gt; &amp;amp; _myUniqueMessage&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; mySecondProvider
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Private&lt;/span&gt;&lt;font color=#000000&gt; _anExtraMessage &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Initialize(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; config &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Collections.Specialized.NameValueCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
Override the method of Configuration.Provider.ProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
default provider name if missing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(name) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; name
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MySecondProvider"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
initialize base and get custom settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(config) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Initialize(name,
config)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
get the setting from config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&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; &lt;/span&gt;_myUniqueMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheCustomSetting"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
this second provider can have its own extra settings&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&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; &lt;/span&gt;_anExtraMessage
= config(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"TheExtraMessage"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;If&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
default setting to something uniquely from this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_myUniqueMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; _myUniqueMessage
= &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"#2 PROVIDER WAS HERE!!"&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: #a31515; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;font color=#000000&gt; GetProviderSpecificMessage() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
build up a return string that is specialized for this provider&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; sb &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; System.Text.StringBuilder&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&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;sb.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"The
Second provider does it differently: "&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&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;sb.Append(_myUniqueMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;.IsNullOrEmpty(_anExtraMessage) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; sb.Append(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"
"&lt;/span&gt;&lt;font color=#000000&gt; &amp;amp; _anExtraMessage)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; sb.ToString&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Function&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
We will be swapping out providers through simple changes to the app's .config file&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This can go quite deep to give you a lot more control but here are the basics:&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
1) MyProviderSection, defines a configuration section for app.config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
2) MyProviderCollection, defines the collection of providers listed within our section
of .config&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This class lets the configuration manager create a strongly-typed instance of our&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
section based on the information listed in the application's .config file.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderSection
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ConfigurationSection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;ConfigurationProperty(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"providers"&lt;/span&gt;&lt;font color=#000000&gt;)&amp;gt;
_&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; Providers() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; ProviderSettingsCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"providers"&lt;/span&gt;&lt;font color=#000000&gt;),
ProviderSettingsCollection)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&amp;lt;StringValidator(minLength:=1),
ConfigurationProperty(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;,
defaultvalue:=&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"MyFirstProvider"&lt;/span&gt;&lt;font color=#000000&gt;)&amp;gt;
_&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; DefaultProvider() &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CStr&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;))&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Set&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; value &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"defaultProvider"&lt;/span&gt;&lt;font color=#000000&gt;)
= value&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Set&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
This class lets the configuration manager create a strongly-typed collection of&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: green"&gt;'
providers based on the information listed within the section for our custom provider.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;/span&gt;&lt;font color=#000000&gt; MyProviderCollection
: &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Inherits&lt;/span&gt;&lt;font color=#000000&gt; ProviderCollection&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;ReadOnly&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; name &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;String&lt;/span&gt;&lt;font color=#000000&gt;) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt;&lt;font color=#000000&gt; o &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;&lt;font color=#000000&gt; = &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;&lt;font color=#000000&gt;(name)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; o &lt;/font&gt;&lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;&lt;font color=#000000&gt;(o,
MyProviderBase) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Else&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Return&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Nothing&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Get&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Property&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;Public&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Overrides&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;font color=#000000&gt; Add(&lt;/font&gt;&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;As&lt;/span&gt;&lt;font color=#000000&gt; System.Configuration.Provider.ProviderBase)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
check for valid type (ie, make sure the listed provider inherits from our base)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; IsNothing(provider) &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; ArgumentNullException(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"provider"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;If&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Not&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;TypeOf&lt;/span&gt;&lt;font color=#000000&gt; provider &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Is&lt;/span&gt;&lt;font color=#000000&gt; MyProviderBase &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Throw&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;New&lt;/span&gt;&lt;font color=#000000&gt; ArgumentException(&lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"Invalid
provider type"&lt;/span&gt;&lt;font color=#000000&gt;, &lt;/font&gt;&lt;span style="COLOR: #a31515"&gt;"provider"&lt;/span&gt;&lt;font color=#000000&gt;)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: green"&gt;'
add&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&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="COLOR: blue"&gt;MyBase&lt;/span&gt;&lt;font color=#000000&gt;.Add(provider)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Sub&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;span style="mso-spacerun: yes"&gt;&lt;font color=#000000&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/font&gt;&lt;/span&gt;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Class&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;End&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt; &lt;/font&gt;&lt;span style="COLOR: blue"&gt;Namespace&lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Most
of this is self explanatory and hopefully the code comments will help to make it clear.
Notice that we have a (mustinherit) base class that inherits System.Configuration.Provider.ProviderBase
and defines the single required method “GetProviderSpecificMessage”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;We
have two classes that inherit from that base and override the Initialize method to
load in the configuration goodies that are passed in as a NameValueCollection. 
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;We
also have a custom ConfigurationSection class that minimally extends its base by setting
the defaultProvider’s defaultValue property to “MyFirstProvider”.&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;
&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Finally,
we implement “MyProviderCollection” which inherits from System.Configuration.ProviderCollection
and contains a list of providers that derive from our custom provider base (MyProviderBase.)&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;
&lt;o:p&gt;
&lt;font color=#000000&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;font color=#000000&gt;Download,
run and extend the source in the project and let me know if any of this is useful
to you.&lt;o:p&gt;&lt;/o:p&gt;
&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;o:p&gt;
&lt;font face=Calibri color=#000000 size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;a name=_MailAutoSig&gt;&lt;span style="COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-no-proof: yes; mso-themecolor: dark2"&gt;
&lt;o:p&gt;
&lt;font face=Calibri size=3&gt;&amp;nbsp;&lt;/font&gt;
&lt;/o:p&gt;
&lt;/span&gt;&lt;/a&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;
&lt;span style="mso-bookmark: _MailAutoSig"&gt;&lt;span style="COLOR: #1f497d; mso-fareast-font-family: 'Times New Roman'; mso-fareast-theme-font: minor-fareast; mso-no-proof: yes; mso-themecolor: dark2"&gt;&lt;font size=3&gt;&lt;font face=Calibri&gt;Brian
Mishler&lt;/font&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;a href="http://mishler.net/content/binary/WinformProviderSample.zip"&gt;WinformProviderSample.zip
(99.86 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=28ae2bcd-5ef7-4c12-bd73-06b7d6b77158" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,28ae2bcd-5ef7-4c12-bd73-06b7d6b77158.aspx</comments>
      <category>.Net</category>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=754bd904-454a-478e-8b34-fe2b6e30608c</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=754bd904-454a-478e-8b34-fe2b6e30608c</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In an Asp.Net application, if you
check the properties of the various Asp.Net providers at runtime, you will get a value
that is something of a hybrid between default and custom settings. Similarly, if you
check a property such as </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">ConfigurationManager.ConnectionStrings(“LocalSqlServer”).ConnectionString</span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">,
you will get a value that may originate in web.config or result from a default setting.</span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Why is this?</span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When an Asp.Net 2.0 application
is loaded, the attributes (and behavior) of the various Asp.Net providers (membership,
roleManager, profile and others) are retrieved from sections in machine.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.) 
If the web application includes a web.config file, the configuration sections contained
therein may supplement or override the default behavior.</span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial">So how do you programmatically
determine if a provider is getting its configuration from the default (machine.config)
file or from an application-specific (web.config) file? </span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I recently had to deal with this
issue in testing for various potential user problems with the <a title="http://www.qualitydata.com/products/aspnet-membership/default.aspx" href="http://www.qualitydata.com/products/aspnet-membership/default.aspx"><font color="#800080">Membership
Manager Control</font></a>.  I was simulating a fairly common scenario where
users might configure their AspNetSqlMembershipProvider to store passwords in an encrypted
format but forget to provide a machineKey section.  The machineKey section defines
how to encrypt/decrypt various types of information and, if not defined in web.config,
will produce autogenerated values. Anyone who has tried to go with an encrypted rather
than hashed passwordFormat will have undoubtedly encountered the following message
when they attempt to run the web application:</span>
        </p>
        <p class="MsoNormal" style="MARGIN-LEFT: 0.5in">
          <i>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">You must specify a non-autogenerated
machine key to store passwords in the encrypted format. Either specify a different
passwordFormat, or change the machineKey configuration to use a non-autogenerated
decryption key.</span>
          </i>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This exception is thrown by the
AspNetSQLMembershipProvider to force the web application developer to provide a machineKey
section in web.config.  This requirement is well documented and several excellent
resources are available on the Internet to help you generate the elements needed to
create your own custom machineKey configuration section.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So in my situation, I wanted to
prevent users from changing an individual member’s passwordFormat to Encrypted if
the machineKey was not specified in web.config. I would need a way to determine this
at runtime.  </span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Well, it’s easy enough to get a
strongly typed MachineKeySection object. The following VB.Net method illustrates how
to get an instance of the machineKeySection class for the current web project:</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Public</span><span style="COLOR: blue">Shared</span><span style="COLOR: blue">Function</span> GetMachineKeySection() <span style="COLOR: blue">As</span> System.Web.Configuration.MachineKeySection</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Static</span> section <span style="COLOR: blue">As</span> MachineKeySection<br /></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">If</span> section <span style="COLOR: blue">Is</span><span style="COLOR: blue">Nothing</span><span style="COLOR: blue">Then</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">               
section = <span style="COLOR: blue">CType</span>(System.Web.Configuration.WebConfigurationManager.GetSection(<span style="COLOR: maroon">"system.web/machineKey"</span>),
MachineKeySection)</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">End</span><span style="COLOR: blue">If<br /></span></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Return</span> section</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">End</span><span style="COLOR: blue">Function</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">(Note that </span>
          <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">"system.web/machineKey"</span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> is
case sensitive)</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And when you check the resulting
instance, you will get information in fields such as decryption, decryptionKey, validation
and validationKey – whether or not a machineKey section exists in web.config.  </span>
        </p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span>
          </b> 
</p>
        <p class="MsoNormal">
          <b>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So how can you programmatically
tell if machineKey contains a non-autogenerated decryption key?</span>
          </b>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The <em>ElementInformation</em> class
is typically available as a property of sections such as machineKey and can tell you
if a particular element is a collection, if it can be modified and even the line number
where it is defined in its configuration file. And, of course, Microsoft gives us
the IsPresent property which tells us whether or not the element actually exists in
the configuration file. ElementInformation.IsPresent returns a Boolean and is easy
to use as shown in the VB.Net method listed below.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Public</span><span style="COLOR: blue">Shared</span><span style="COLOR: blue">Function</span> HaveMachineKey() <span style="COLOR: blue">As</span><span style="COLOR: blue">Boolean</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">Dim</span> section<span style="COLOR: blue"> As</span> MachineKeySection
= GetMachineKeySection() ' see above </span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">If</span><span style="COLOR: blue">Not</span> section<span style="COLOR: blue"> Is</span><span style="COLOR: blue">Nothing</span><span style="COLOR: blue">Then</span> <br />
               </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">section.ElementInformation.IsPresent<br /></span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <font color="#0000ff">End
If</font></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">End</span><span style="COLOR: blue">Function</span></span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The model for strongly typed configuration
classes has been around since .Net 1.0 and is available for WinForms as well as WebForms
applications. Custom configuration classes are relatively easy to create and provide
a big step up from INI files.  In the 2.0 .Net Framework, configuration classes
are even easier to create and provide lots of great new capabilities. This ability
to inherit and override configuration settings does a great job in supporting the
provider model and features such as the <strong>ElementInformation</strong> class
give the programmer all the information he/she needs to determine the source of any
particular configuration section.</span>
        </p>
        <p class="MsoNormal">
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span>
          <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
          </span> 
</p>
        <div>
          <p class="MsoAutoSig">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <p class="MsoAutoSig">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <a title="http://www.qualitydata.com/" href="http://www.qualitydata.com/">
                <font color="#800080">http://www.qualitydata.com</font>
              </a>
            </span>
          </p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=754bd904-454a-478e-8b34-fe2b6e30608c" />
      </body>
      <title>How to determine where a provider is configured</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</guid>
      <link>http://mishler.net/2006/04/27/HowToDetermineWhereAProviderIsConfigured.aspx</link>
      <pubDate>Thu, 27 Apr 2006 12:28:52 GMT</pubDate>
      <description>&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In an Asp.Net application, if you
check the properties of the various Asp.Net providers at runtime, you will get a value
that is something of a hybrid between default and custom settings. Similarly, if you
check a property such as &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;ConfigurationManager.ConnectionStrings(“LocalSqlServer”).ConnectionString&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;,
you will get a value that may originate in web.config or result from a default setting.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Why is this?&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;When an Asp.Net 2.0 application
is loaded, the attributes (and behavior) of the various Asp.Net providers (membership,
roleManager, profile and others) are retrieved from sections in machine.config (C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.)&amp;nbsp;
If the web application includes a web.config file, the configuration sections contained
therein may supplement or override the default behavior.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: Arial"&gt;So how do you programmatically
determine if a provider is getting its configuration from the default (machine.config)
file or from an application-specific (web.config) file? &lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I recently had to deal with this
issue in testing for various potential user problems with the &lt;a title=http://www.qualitydata.com/products/aspnet-membership/default.aspx href="http://www.qualitydata.com/products/aspnet-membership/default.aspx"&gt;&lt;font color=#800080&gt;Membership
Manager Control&lt;/font&gt;&lt;/a&gt;.&amp;nbsp; I was simulating a fairly common scenario where
users might configure their AspNetSqlMembershipProvider to store passwords in an encrypted
format but forget to provide a machineKey section.&amp;nbsp; The machineKey section defines
how to encrypt/decrypt various types of information and, if not defined in web.config,
will produce autogenerated values. Anyone who has tried to go with an encrypted rather
than hashed passwordFormat will have undoubtedly encountered the following message
when they attempt to run the web application:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;You must specify a non-autogenerated
machine key to store passwords in the encrypted format. Either specify a different
passwordFormat, or change the machineKey configuration to use a non-autogenerated
decryption key.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This exception is thrown by the
AspNetSQLMembershipProvider to force the web application developer to provide a machineKey
section in web.config. &amp;nbsp;This requirement is well documented and several excellent
resources are available on the Internet to help you generate the elements needed to
create your own custom machineKey configuration section.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So in my situation, I wanted to
prevent users from changing an individual member’s passwordFormat to Encrypted if
the machineKey was not specified in web.config. I would need a way to determine this
at runtime.&amp;nbsp;&amp;nbsp;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Well, it’s easy enough to get a
strongly typed MachineKeySection object. The following VB.Net method illustrates how
to get an instance of the machineKeySection class for the current web project:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; GetMachineKeySection() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.Web.Configuration.MachineKeySection&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Static&lt;/span&gt; section &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; MachineKeySection&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; section &lt;span style="COLOR: blue"&gt;Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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;
section = &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(System.Web.Configuration.WebConfigurationManager.GetSection(&lt;span style="COLOR: maroon"&gt;"system.web/machineKey"&lt;/span&gt;),
MachineKeySection)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;br&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Return&lt;/span&gt; section&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(Note that &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;"system.web/machineKey"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; is
case sensitive)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;And when you check the resulting
instance, you will get information in fields such as decryption, decryptionKey, validation
and validationKey – whether or not a machineKey section exists in web.config.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;/b&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So how can you programmatically
tell if machineKey contains a non-autogenerated decryption key?&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The &lt;em&gt;ElementInformation&lt;/em&gt; class
is typically available as a property of sections such as machineKey and can tell you
if a particular element is a collection, if it can be modified and even the line number
where it is defined in its configuration file. And, of course, Microsoft gives us
the IsPresent property which tells us whether or not the element actually exists in
the configuration file. ElementInformation.IsPresent returns a Boolean and is easy
to use as shown in the VB.Net method listed below.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Public&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Shared&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt; HaveMachineKey() &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Boolean&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; section&lt;span style="COLOR: blue"&gt; As&lt;/span&gt; MachineKeySection
= GetMachineKeySection() ' see above &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Not&lt;/span&gt; section&lt;span style="COLOR: blue"&gt; Is&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;section.ElementInformation.IsPresent&lt;br&gt;
&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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;&lt;font color=#0000ff&gt;End
If&lt;/font&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Function&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The model for strongly typed configuration
classes has been around since .Net 1.0 and is available for WinForms as well as WebForms
applications. Custom configuration classes are relatively easy to create and provide
a big step up from INI files. &amp;nbsp;In the 2.0 .Net Framework, configuration classes
are even easier to create and provide lots of great new capabilities. This ability
to inherit and override configuration settings does a great job in supporting the
provider model and features such as the &lt;strong&gt;ElementInformation&lt;/strong&gt; class
give the programmer all the information he/she needs to determine the source of any
particular configuration section.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a title=http://www.qualitydata.com/ href="http://www.qualitydata.com/"&gt;&lt;font color=#800080&gt;http://www.qualitydata.com&lt;/font&gt;&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=754bd904-454a-478e-8b34-fe2b6e30608c" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,754bd904-454a-478e-8b34-fe2b6e30608c.aspx</comments>
      <category>.Net</category>
      <category>Asp.Net</category>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This is one of those “..note to
self” blogs to document for future reference the meaning of the exception message: </span>
          </p>
          <p class="MsoNormal">
            <i>Format of the initialization string does not conform to specification starting
at index 0</i>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To me this actually means:</span>
          </p>
          <p class="MsoNormal">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">When the provider is being initialized
with a collection of key/value pairs, the string that defines those key/value pairs
is not properly formatted.</span>
            </i>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Perhaps that would be obvious to
most but in my case, the exception would be difficult to track down in the field since
a provider to my provider was actually throwing the exception.  In particular,
my provider (AspNetSqlMembershipProvider) had a properly configured ConnectionStringName
attribute but the format of the corresponding connection string (in the web.config
connectionstrings section) was not properly formatted as “data source=…”. (I had gone
with the proverbial </span>
            <span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'">connectionString</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">=</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">"<span style="COLOR: blue">Foo</span>"</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> to
see if/how it would blow.)  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In fact, it was the SqlClient Data
Provider that was originating the exception, at least in my case. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I post this here so that if I get
“oldTimers” or if anyone else suffers from the exception, it may help offer a clue.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7" />
      </body>
      <title>Translated Configuration Exception Message, part 1</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7.aspx</guid>
      <link>http://mishler.net/2006/04/18/TranslatedConfigurationExceptionMessagePart1.aspx</link>
      <pubDate>Tue, 18 Apr 2006 21:56:21 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is one of those “..note to
self” blogs to document for future reference the meaning of the exception message: &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;i&gt;Format of the initialization string does not conform to specification starting
at index 0&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To me this actually means:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;When the provider is being initialized
with a collection of key/value pairs, the string that defines those key/value pairs
is not properly formatted.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Perhaps that would be obvious to
most but in my case, the exception would be difficult to track down in the field since
a provider to my provider was actually throwing the exception. &amp;nbsp;In particular,
my provider (AspNetSqlMembershipProvider) had a properly configured ConnectionStringName
attribute but the format of the corresponding connection string (in the web.config
connectionstrings section) was not properly formatted as “data source=…”. (I had gone
with the proverbial &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: red; FONT-FAMILY: 'Courier New'"&gt;connectionString&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;=&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;"&lt;span style="COLOR: blue"&gt;Foo&lt;/span&gt;"&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; to
see if/how it would blow.)&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In fact, it was the SqlClient Data
Provider that was originating the exception, at least in my case. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I post this here so that if I get
“oldTimers” or if anyone else suffers from the exception, it may help offer a clue.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,b140abd4-6f9e-43e5-8ec3-8e5f19c95ea7.aspx</comments>
      <category>Asp.Net</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=ea65afc0-2970-46f1-9412-4b57bbd906f4</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=ea65afc0-2970-46f1-9412-4b57bbd906f4</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
The Asp.net membership provider was designed to allow for self-service password management
but through an understanding of the configuration options as well as a combined use
certain provider methods, web site administrators can effectively manage member passwords. 
This article briefly summarizes the various settings and methods which can be combined
to administratively manage passwords in an Asp.Net membership system based on the
default SQLMembershipProvider.
</p>
          <p class="MsoNormal">
The following (web.config) configuration options define how the AspNetSqlMembershipProvider
behaves:
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>enablePasswordRetrieval</b> – Enables/disables the membership provider’s GetPassword
method. Note that GetPassword will always throw an exception if the user’s password
is hashed. Default value is <i>false</i>.  Requires the password answer unless
“requiresQuestionAndAnswer” in web.config is set to false.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>enablePasswordReset</b> – Enables/disables the membership provider’s ResetPassword
method, which can be used to produce a randomly generated password. Default value
is <i>true</i>.  ResetPassword requires the user’s passwordAnswer unless “requiresQuestionAndAnswer”
in web.config is set to <i>false</i>.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>requiresQuestionAndAnswer</b> – Alters the behavior of the GetPassword and ResetPassword
methods to require or not require the password answer parameter. Default value is <i>true</i>.
This method is the key for administrative management of passwords since, by turning
it off, administrators can retrieve or reset passwords.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>passwordFormat</b> – Defines how passwords will be stored when membership records
are created. Note that once a membership record has been created, functions such as
ChangePassword and ResetPassword will continue to store the credentials in the original
passwordFormat, even if web.config is changed to use a different password format. 
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Clear             the
password and password answer are stored in clear text. The passwordSalt field (in
the database) is left blank.
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Encrypted      the password, password answer and passwordSalt
are stored in an encrypted format within the database using the key information supplied
in the machineKey element of web.config
</p>
          <p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%">
Hashed          the password and password
answer are hashed using a one-way hash algorithm and a randomly generated passwordSalt
value.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Microsoft set the default value of passwordFormat to Hashed in order to promote their
secure web initiative but for many applications, this level of security is overkill
and can create inconveniences in managing passwords.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Given the above information, there are a number of approaches that can be taken to
administratively manage membership passwords. Note that “administrative” management
implies that the administrator does not know the member’s password or password answer.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Retrieving a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The GetPassword method may be used to retrieve a member’s password and, at first glance,
appears to require the password answer. By setting “requiresQuestionAndAnswer” to <i>false</i> in
web.config, the GetPassword method can be called with an empty password answer and
therefore can be effectively used to administratively retrieve a member’s password.
Note that “enablePasswordRetrieval” must be set to <i>true</i> in web.config to enable
the GetPassword method:
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 If password is:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Not
possible, however the password may be reset as described below.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In Visual Basic, you can call the shared GetPassword method as illustrated below.
Note that the second parameter would be for the password answer if “requiresQuestionAndAnswer”
were <i>true</i> in web.config.
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"> password <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
Membership.Provider.GetPassword(userName, <span style="COLOR: blue">String</span>.Empty)</span>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Resetting a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The ResetPassword method may be used to generate a new, randomly generated password
and, at first glance, appears to require the user’s password answer. By setting “requiresQuestionAndAnswer”
to <i>false</i> in web.config, the ResetPassword method can be called with an empty
password answer to set a user’s password to some new randomly generated value. 
ResetPassword works with all password formats (clear, encrypted, hashed).
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In Visual Basic, you can call the shared ResetPassword method as illustrated below.
Note that you can pass <i>Nothing</i> for the second parameter, passwordAnswer.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'">Dim</span>
            <span style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"> newPassword <span style="COLOR: blue">As</span><span style="COLOR: blue">String</span> =
Membership.Provider.ResetPassword(username, <span style="COLOR: blue">Nothing</span>)</span>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing a member’s password</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In some organizations, a Customer Service department may wish to change a user’s password
to a new known value, perhaps in response to a customer request. The ChangePassword
method, which appears to handle this need, unfortunately requires the original user
password which is usually unavailable to the site administrator. By setting “requiresQuestionAndAnswer”
to <i>false</i>, “enablePasswordRetrieval” to <i>true</i> and “enablePasswordReset”
to <i>true</i> in web.config, the ResetPassword and ChangePassword methods can be
used to change a user’s password to a known value, regardless of the password format:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePassword to set the password to a desired value
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>
            </b> 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing a member’s Password Question and Password Answer</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
In some situations, the Customer Service department may wish to modify a member’s
Password Question and Password Answer. This is easily accomplished if passwords are
encrypted or maintained in clear text. For hashed passwords, however, a password-reset
is also required since the provider method, ChangePasswordQuestionAndAnswer, requires
the member’s password which is not retrievable. By setting “requiresQuestionAndAnswer”
to <i>false</i>, “enablePasswordRetrieval” to <i>true</i> and “enablePasswordReset”
to <i>true</i> in web.config, the member’s Password Question and Password Answer may
be reset:
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Clear text         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Encrypted         Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
</p>
          <p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%">
Hashed             Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePasswordQuestionAndAnswer to set the Password Question and Password Answer to
a desired value. Optionally call ChangePassword to set the password to a more user-friendly
value.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Changing the password format</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
As web sites mature, website administrators sometimes regret their original (sometimes
unintended) choice in passwordFormat when using the AspNetSqlMembershipProvider. That
is, membership passwords may be clear text when a hashed format is desired or vice
versa. Microsoft’s decision to implement hashing in the default AspNetSqlMembershipProvider
was wise and conservative but for many web sites with minimal security requirements,
the password system can become cumbersome.  By directly calling a couple of the
AspNet stored procedures, it is possible to change the password format:
</p>
          <p dir="ltr" style="MARGIN-BOTTOM: 7.5pt; MARGIN-LEFT: 1in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; MARGIN-RIGHT: 0.5in">
Note: If the passwordFormat is initially “Clear” or “Encrypted”, use the membership.provider.GetPassword
method to cache the original password before calling the stored procedures.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>Use
the stored procedure aspnet Membership GetPasswordWithFormat to retrieve the current
passwordSalt.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Use
the stored procedure aspnet Membership ResetPassword to set the passwordFormat to
its intended (integer) value. The stored procedure requires readily available parameter
values including passwordSalt (retrieved earlier), password (empty string) and passwordAnswer
(Null).
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
At this point, the membership record has been placed into an initialized (unusable)
state and the PasswordAnswer has been lost. If the original password was hashed, then
it too will be unrecoverable.  The provider methods listed below and described
in previous sections allow for resetting the credentials and, as they are used, the
password and password answer will be stored in the new password format (clear, encrypted,
hashed.)
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>Call
the ResetPassword method to generate and retrieve a new random Password. Remember
that the second parameter (answer) is not required if “requiresQuestionAndAnswer”
is set to false in web.config.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Call
the ChangePassword method, using the now-current password retrieved in the previous
step, to set the password to a desired value.  If the original password was saved
at the start of the procedure, it may be restored at this point. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
For originally un-hashed passwords, the preceding steps allow for a change of passwordFormat
with complete restoration of the original password. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
The Password Answer could have easily been retrieved from the database at the outset
if it was stored in clear text. In the case of an encrypted Password Answer, a more
complicated approach which involves the provider’s protected DecryptPassword method
could have been used to cache the original Password Answer.  If the original
Password Answer were available, it could be restored with a call to the ChangePasswordQuestionAndAnswer
provider method.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
So, what can be done if the Password and/or Password Answer had to be sacrificed in
favor of a new passwordFormat?  One solution might be to reset everyone’s credentials
then send them by Email. Another solution might be to place a notice onto the web
site that informs users and provides further instructions. Either way, the web site
should leverage the self-service membership controls which allow the member to reset
his/her own credentials.  The following outlines a series of steps that can be
taken:
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
1.<span style="FONT: 7pt 'Times New Roman'">      </span>A
new arbitrary password can be assigned using either the ResetPassword or ChangePassword
provider method. Similarly, a new arbitrary Password Question and Password Answer
can be assigned using the ChangePasswordQuestionAndAnswer provider method.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
2.<span style="FONT: 7pt 'Times New Roman'">      </span>Since
the user will not know his/her new credentials, ensure the Login Control includes
the necessary properties (PasswordRecoveryText and PasswordRecoveryURL) to link the
user to a page that includes a PasswordRecovery Control.
</p>
          <p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%">
3.<span style="FONT: 7pt 'Times New Roman'">      </span>Recall
that the PasswordRecovery Control is driven by the provider settings in web.config.
In particular, ensure that “requiresQuestionAndAnswer” is set to false so the PasswordRecovery
Control does not prompt the user for a Password Answer. Also, ensure that the SMTP
setting is specified in web.config so that the Email will be sent. If the membership
record uses a hashed password format then a new (random) password will be sent, otherwise
the password you assigned in the previous step will be sent.
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
            <b>Conclusion</b>
          </p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Armed with a little knowledge, it is possible to use the membership provider methods
to perform basic administrative functions for an otherwise self-service web site.
It is possible (although probably undesirable) to have a mix of clear, encrypted and
hashed passwords in the same database. Depending on the passwordFormat for a particular
record, varying levels of administrative control are available. For the AspNetSqlMembershipProvider,
it is possible to change the passwordFormat for a particular record using a combination
of built-in stored procedure calls and membership provider methods. 
</p>
          <p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%">
Microsoft has done a good job in engineering the membership provider system and has
really left no security holes. The procedures outlined here utilize a combination
of built-in stored procedures as well as standard provider methods to accomplish certain
activities that are routinely required of site administrators.
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=ea65afc0-2970-46f1-9412-4b57bbd906f4" />
      </body>
      <title>Asp.Net Membership Password Administration</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</guid>
      <link>http://mishler.net/2006/04/18/AspNetMembershipPasswordAdministration.aspx</link>
      <pubDate>Tue, 18 Apr 2006 01:47:20 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
The Asp.net membership provider was designed to allow for self-service password management
but through an understanding of the configuration options as well as a combined use
certain provider methods, web site administrators can effectively manage member passwords.&amp;nbsp;
This article briefly summarizes the various settings and methods which can be combined
to administratively manage passwords in an Asp.Net membership system based on the
default SQLMembershipProvider.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
The following (web.config) configuration options define how&amp;nbsp;the AspNetSqlMembershipProvider
behaves:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;enablePasswordRetrieval&lt;/b&gt; – Enables/disables the membership provider’s GetPassword
method. Note that GetPassword will always throw an exception if the user’s password
is hashed. Default value is &lt;i&gt;false&lt;/i&gt;.&amp;nbsp; Requires the password answer unless
“requiresQuestionAndAnswer” in web.config is set to false.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;enablePasswordReset&lt;/b&gt; – Enables/disables the membership provider’s ResetPassword
method, which can be used to produce a randomly generated password. Default value
is &lt;i&gt;true&lt;/i&gt;.&amp;nbsp; ResetPassword requires the user’s passwordAnswer unless “requiresQuestionAndAnswer”
in web.config is set to &lt;i&gt;false&lt;/i&gt;.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;requiresQuestionAndAnswer&lt;/b&gt; – Alters the behavior of the GetPassword and ResetPassword
methods to require or not require the password answer parameter. Default value is &lt;i&gt;true&lt;/i&gt;.
This method is the key for administrative management of passwords since, by turning
it off, administrators can retrieve or reset passwords.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;passwordFormat&lt;/b&gt; – Defines how passwords will be stored when membership records
are created. Note that once a membership record has been created, functions such as
ChangePassword and ResetPassword will continue to store the credentials in the original
passwordFormat, even if web.config is changed to use a different password format. 
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Clear&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the
password and password answer are stored in clear text. The passwordSalt field (in
the database) is left blank.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Encrypted &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the password, password answer and passwordSalt
are stored in an encrypted format within the database using the key information supplied
in the machineKey element of web.config
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 135pt; VERTICAL-ALIGN: top; TEXT-INDENT: -63pt; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the password and password
answer are hashed using a one-way hash algorithm and a randomly generated passwordSalt
value.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Microsoft set the default value of passwordFormat to Hashed in order to promote their
secure web initiative but for many applications, this level of security is overkill
and can create inconveniences in managing passwords.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Given the above information, there are a number of approaches that can be taken to
administratively manage membership passwords. Note that “administrative” management
implies that the administrator does not know the member’s password or password answer.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Retrieving a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The GetPassword method may be used to retrieve a member’s password and, at first glance,
appears to require the password answer. By setting “requiresQuestionAndAnswer” to &lt;i&gt;false&lt;/i&gt; in
web.config, the GetPassword method can be called with an empty password answer and
therefore can be effectively used to administratively retrieve a member’s password.
Note that “enablePasswordRetrieval” must be set to &lt;i&gt;true&lt;/i&gt; in web.config to enable
the GetPassword method:
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;If password is:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Simply call the GetPassword
method with the username and without the need for a password answer to retrieve the
password
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Not
possible, however the password may be reset as described below.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In Visual Basic, you can call the shared GetPassword method as illustrated below.
Note that the second parameter would be for the password answer if “requiresQuestionAndAnswer”
were &lt;i&gt;true&lt;/i&gt; in web.config.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; password &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
Membership.Provider.GetPassword(userName, &lt;span style="COLOR: blue"&gt;String&lt;/span&gt;.Empty)&lt;/span&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Resetting a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The ResetPassword method may be used to generate a new, randomly generated password
and, at first glance, appears to require the user’s password answer. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt; in web.config, the ResetPassword method can be called with an empty
password answer to set a user’s password to some new randomly generated value.&amp;nbsp;
ResetPassword works with all password formats (clear, encrypted, hashed).
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In Visual Basic, you can call the shared ResetPassword method as illustrated below.
Note that you can pass &lt;i&gt;Nothing&lt;/i&gt; for the second parameter, passwordAnswer.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"&gt;Dim&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; LINE-HEIGHT: 140%; FONT-FAMILY: 'Courier New'"&gt; newPassword &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;String&lt;/span&gt; =
Membership.Provider.ResetPassword(username, &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing a member’s password&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In some organizations, a Customer Service department may wish to change a user’s password
to a new known value, perhaps in response to a customer request. The ChangePassword
method, which appears to handle this need, unfortunately requires the original user
password which is usually unavailable to the site administrator. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt;, “enablePasswordRetrieval” to &lt;i&gt;true&lt;/i&gt; and “enablePasswordReset”
to &lt;i&gt;true&lt;/i&gt; in web.config, the ResetPassword and ChangePassword methods can be
used to change a user’s password to a known value, regardless of the password format:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePassword to set the password to a desired
value
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePassword to set the password to a desired value
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;&lt;/b&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing a member’s Password Question and Password Answer&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
In some situations, the Customer Service department may wish to modify a member’s
Password Question and Password Answer. This is easily accomplished if passwords are
encrypted or maintained in clear text. For hashed passwords, however, a password-reset
is also required since the provider method, ChangePasswordQuestionAndAnswer, requires
the member’s password which is not retrievable. By setting “requiresQuestionAndAnswer”
to &lt;i&gt;false&lt;/i&gt;, “enablePasswordRetrieval” to &lt;i&gt;true&lt;/i&gt; and “enablePasswordReset”
to &lt;i&gt;true&lt;/i&gt; in web.config, the member’s Password Question and Password Answer may
be reset:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Clear text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Encrypted&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call the GetPassword method
with the username and without the need for a password answer to retrieve the password.
Now, armed with the password, call ChangePasswordQuestionAndAnswer to set the Password
Question and Password Answer to a desired value.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 1.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -1in; LINE-HEIGHT: 140%"&gt;
Hashed&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call
the ResetPassword method with the username and without the need for a password answer
to reset the password to a new random value. Using the newly generated password, call
ChangePasswordQuestionAndAnswer to set the Password Question and Password Answer to
a desired value. Optionally call ChangePassword to set the password to a more user-friendly
value.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Changing the password format&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
As web sites mature, website administrators sometimes regret their original (sometimes
unintended) choice in passwordFormat when using the AspNetSqlMembershipProvider. That
is, membership passwords may be clear text when a hashed format is desired or vice
versa. Microsoft’s decision to implement hashing in the default AspNetSqlMembershipProvider
was wise and conservative but for many web sites with minimal security requirements,
the password system can become cumbersome. &amp;nbsp;By directly calling a couple of the
AspNet stored procedures, it is possible to change the password format:
&lt;/p&gt;
&lt;p dir=ltr style="MARGIN-BOTTOM: 7.5pt; MARGIN-LEFT: 1in; VERTICAL-ALIGN: top; LINE-HEIGHT: 140%; MARGIN-RIGHT: 0.5in"&gt;
Note: If the passwordFormat is initially “Clear” or “Encrypted”, use the membership.provider.GetPassword
method to cache the original password before calling the stored procedures.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use
the stored procedure aspnet Membership GetPasswordWithFormat to retrieve the current
passwordSalt.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Use
the stored procedure aspnet Membership ResetPassword to set the passwordFormat to
its intended (integer) value. The stored procedure requires readily available parameter
values including passwordSalt (retrieved earlier), password (empty string) and passwordAnswer
(Null).
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
At this point, the membership record has been placed into an initialized (unusable)
state and the PasswordAnswer has been lost. If the original password was hashed, then
it too will be unrecoverable.&amp;nbsp; The provider methods listed below and described
in previous sections allow for resetting the credentials and, as they are used, the
password and password answer will be stored in the new password format (clear, encrypted,
hashed.)
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Call
the ResetPassword method to generate and retrieve a new random Password. Remember
that the second parameter (answer) is not required if “requiresQuestionAndAnswer”
is set to false in web.config.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Call
the ChangePassword method, using the now-current password retrieved in the previous
step, to set the password to a desired value.&amp;nbsp; If the original password was saved
at the start of the procedure, it may be restored at this point. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
For originally un-hashed passwords, the preceding steps allow for a change of passwordFormat
with complete restoration of the original password. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
The Password Answer could have easily been retrieved from the database at the outset
if it was stored in clear text. In the case of an encrypted Password Answer, a more
complicated approach which involves the provider’s protected DecryptPassword method
could have been used to cache the original Password Answer.&amp;nbsp; If the original
Password Answer were available, it could be restored with a call to the ChangePasswordQuestionAndAnswer
provider method.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
So, what can be done if the Password and/or Password Answer had to be sacrificed in
favor of a new passwordFormat?&amp;nbsp; One solution might be to reset everyone’s credentials
then send them by Email. Another solution might be to place a notice onto the web
site that informs users and provides further instructions. Either way, the web site
should leverage the self-service membership controls which allow the member to reset
his/her own credentials.&amp;nbsp; The following outlines a series of steps that can be
taken:
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
1.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;A
new arbitrary password can be assigned using either the ResetPassword or ChangePassword
provider method. Similarly, a new arbitrary Password Question and Password Answer
can be assigned using the ChangePasswordQuestionAndAnswer provider method.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
2.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Since
the user will not know his/her new credentials, ensure the Login Control includes
the necessary properties (PasswordRecoveryText and PasswordRecoveryURL) to link the
user to a page that includes a PasswordRecovery Control.
&lt;/p&gt;
&lt;p style="MARGIN-LEFT: 0.5in; VERTICAL-ALIGN: top; TEXT-INDENT: -0.25in; LINE-HEIGHT: 140%"&gt;
3.&lt;span style="FONT: 7pt 'Times New Roman'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Recall
that the PasswordRecovery Control is driven by the provider settings in web.config.
In particular, ensure that “requiresQuestionAndAnswer” is set to false so the PasswordRecovery
Control does not prompt the user for a Password Answer. Also, ensure that the SMTP
setting is specified in web.config so that the Email will be sent. If the membership
record uses a hashed password format then a new (random) password will be sent, otherwise
the password you assigned in the previous step will be sent.
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
&lt;b&gt;Conclusion&lt;/b&gt;
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Armed with a little knowledge, it is possible to use the membership provider methods
to perform basic administrative functions for an otherwise self-service web site.
It is possible (although probably undesirable) to have a mix of clear, encrypted and
hashed passwords in the same database. Depending on the passwordFormat for a particular
record, varying levels of administrative control are available. For the AspNetSqlMembershipProvider,
it is possible to change the passwordFormat for a particular record using a combination
of built-in stored procedure calls and membership provider methods. 
&lt;/p&gt;
&lt;p style="VERTICAL-ALIGN: top; LINE-HEIGHT: 140%"&gt;
Microsoft has done a good job in engineering the membership provider system and has
really left no security holes. The procedures outlined here utilize a combination
of built-in stored procedures as well as standard provider methods to accomplish certain
activities that are routinely required of site administrators.
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=ea65afc0-2970-46f1-9412-4b57bbd906f4" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,ea65afc0-2970-46f1-9412-4b57bbd906f4.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=98a72720-e617-4117-9ce7-db3482617e31</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=98a72720-e617-4117-9ce7-db3482617e31</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">As an Independent Software Vendor
(ISV), I make my living writing a software program and (hopefully) selling it many
times. For the most part, the application meets the customer’s requirements right
“out of the box” and if there is a gap, the customer is usually able to work around
it.  Every now and then, a potential customer will dangle the carrot out there,
that if certain features are added then they’ll buy a lot of copies. Or, they would
buy it if it could be integrated with their existing XYZ-system.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now I’m not talking about the practice
of accepting customer suggestions for a systematic improvement of a maturing product.
I’m talking about adding appendages where they just don’t belong. Over the years,
I’ve occasionally succumbed to these pressures and in some cases, the products were
better off for it. Other times, the extra features were like anchors around our feet
as now had customer-specific business rules in our mainstream product.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The Provider Model</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I’m sure the Provider Model has
been around for a while but I first heard the term “Provider” back when Microsoft
was introducing its “Universal Data Access” strategy (I seem to recall this was all
part of the transition to MDAC.)  For the next few years, of course, we all used
the “ODBC Provider” or the “SQL Server Provider” in our database applications and
(at least I) did not think much more of it. </span>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In general, the provider model
is a design pattern that allows, through configuration, an alternate provider of application
functionality to be substituted with requiring modification to the primary application.</span>
            </i>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">(There’s probably a better text-book
definition for this but my definition suits me just fine)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">A few years back, I read a couple
of articles on MSDN about “Providers” and proceeded to build my own for one of our
products, the <a href="http://www.pocketforms.net/enterprise/Default.aspx">PocketForms
Web Service</a>. I was intrigued about the idea of letting customers easily override
the default implementation of any of my web methods and figured this might provide
a nice “catch all” for the occasional special-requirements customer.  Back then,
there was no base provider class in the .Net Framework but several good examples were
available for guidance.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I found that most of the work was
actually in setting up various configuration classes that would be used to manage
optional user settings. The application, itself, required some fairly straight-forward
design changes, mainly in creating a new “MustInherit” base class that defined the
interfaces that my existing class already implemented.  All-in-all, it took just
a couple of days to retrofit my existing application with this new design pattern.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Fantastic Return on Investment</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I must say that the investment in
learning about and implementing the Provider Model has been one of the best decisions
I have ever made professionally. As it turns out, <i>most</i> of our customers take
advantage of this in one way or another. Some have custom authentication requirements,
some want to do special handling with posted data and others just want to log certain
activities. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Last year, we released our <a href="http://www.qualitydata.com/solutions/pocket-pc-sharepoint.aspx">Sharepoint
Bridge</a> which is a “shrink wrapped” provider to make our product work with Sharepoint
Portal Server and Windows Sharepoint Services and have attracted a lot of attention
from organizations that wanted an easy way to push mobile data into their existing
Sharepoint-based intranet. This extra capability can be customized and improved on
its own product cycle without ever affecting the functionality of the primary product.
And, as we upgrade our web service with additional features, our custom providers
continue to work.</span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Now easier than ever</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">With the release of the .Net Framework
2.0, Microsoft included a base provider class in the framework itself.  We were
able to dump all of our plumbing code and simply inherit our base classes from the
new </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">System.Configuration.Provider.ProviderBase </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">class. 
The various configuration (ConfigurationSection, ProviderCollection, etc.) classes
have also been simplified, so we cleaned up our existing configuration code as well.</span>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 1in">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">There are plenty of articles
on MSDN and elsewhere on using the provider model, so it would be redundant for me
to go through all that here. In a future post, I plan provide a real working example
in case anyone wants a nice starter project.</span>
            </i>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Not just for Asp.Net</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">With the release of Visual Studio
2005, Microsoft showed off the new Asp.Net Membership System in just about every presentation
they gave. Everyone was impressed with the instant login and user creation controls
and when Microsoft was asked the question “what if we want to change the implementation”,
they were able to point to the provider-based implementation of their Membership System.
Since there is such a high adoption rate of the Asp.Net Membership System, many folks
associate the term “provider” with the Role, Membership and Profile providers in Asp.Net.
Many programmers will go on to assume that this means the “AspNetSqlRoleProvider”,
“AspNetSqlMembershipProvider” and “AspNetProfileProvider” and lose sight of the fact
that these are just the default (if not the most common) implementations of the base
provider classes.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">More and more ISV’s are recognizing
that this model is not only useful for supporting unplanned circumstances but will
also become more in demand with the increased adoption rate of Microsoft’s development
platforms.  The investment is minimal and the potential rewards are significant.
As I evaluate new applications, I have gotten into the habit of reading the configuration
files and lately have seen an increased number of “shrink wrap” programs that have
some form of provider-based implementation. One good example is <a href="http://communityserver.org/">Telligent’s
Community Server</a> that appears to have largely been built on base provider classes.
I have not seen much documentation on this but I would assume that Telligent built
it this way so that organizations could swap out some of the implementation. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The provider model works well for
Asp.Net (web) applications since the appropriate provider is loaded once and based
on the settings in Web.Config. It also works well for WinForms applications, although
a change in the application’s configuration file does not automatically cause a running
application to restart and reload a different provider. </span>
          </p>
          <p class="MsoNormal">
            <b>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">From one ISV to another…</span>
            </b>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So, if you are an ISV building solutions
on the Microsoft .Net platform, you owe it to yourself to consider a provider-based
implementation of your application. You’ll find you are able to satisfy many unexpected
requirements and not have to saddle your application with extra features that will
need to be optionally disabled in future releases.  Another big benefit is the
additional revenue stream you open up with new add-on products like your “Oracle Provider”
or “SAP Provider”.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I love this subject and, while I
have had a lot of success in actually using it, keep finding there is more to learn.
Your comments are welcome.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
          </p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=98a72720-e617-4117-9ce7-db3482617e31" />
      </body>
      <title>Why the Provider Model is so important to ISV's</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</guid>
      <link>http://mishler.net/2006/04/14/WhyTheProviderModelIsSoImportantToISVs.aspx</link>
      <pubDate>Fri, 14 Apr 2006 16:25:26 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;As an Independent Software Vendor
(ISV), I make my living writing a software program and (hopefully) selling it many
times. For the most part, the application meets the customer’s requirements right
“out of the box” and if there is a gap, the customer is usually able to work around
it.&amp;nbsp; Every now and then, a potential customer will dangle the carrot out there,
that if certain features are added then they’ll buy a lot of copies. Or, they would
buy it if it could be integrated with their existing XYZ-system.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Now I’m not talking about the practice
of accepting customer suggestions for a systematic improvement of a maturing product.
I’m talking about adding appendages where they just don’t belong. Over the years,
I’ve occasionally succumbed to these pressures and in some cases, the products were
better off for it. Other times, the extra features were like anchors around our feet
as now had customer-specific business rules in our mainstream product.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The Provider Model&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I’m sure the Provider Model has
been around for a while but I first heard the term “Provider” back when Microsoft
was introducing its “Universal Data Access” strategy (I seem to recall this was all
part of the transition to MDAC.)&amp;nbsp; For the next few years, of course, we all used
the “ODBC Provider” or the “SQL Server Provider” in our database applications and
(at least I) did not think much more of it. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In general, the provider model
is a design pattern that allows, through configuration, an alternate provider of application
functionality to be substituted with requiring modification to the primary application.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;(There’s probably a better text-book
definition for this but my definition suits me just fine)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;A few years back, I read a couple
of articles on MSDN about “Providers” and proceeded to build my own for one of our
products, the &lt;a href="http://www.pocketforms.net/enterprise/Default.aspx"&gt;PocketForms
Web Service&lt;/a&gt;. I was intrigued about the idea of letting customers easily override
the default implementation of any of my web methods and figured this might provide
a nice “catch all” for the occasional special-requirements customer.&amp;nbsp; Back then,
there was no base provider class in the .Net Framework but several good examples were
available for guidance.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I found that most of the work was
actually in setting up various configuration classes that would be used to manage
optional user settings. The application, itself, required some fairly straight-forward
design changes, mainly in creating a new “MustInherit” base class that defined the
interfaces that my existing class already implemented.&amp;nbsp; All-in-all, it took just
a couple of days to retrofit my existing application with this new design pattern.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Fantastic Return on Investment&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I must say that the investment in
learning about and implementing the Provider Model has been one of the best decisions
I have ever made professionally. As it turns out, &lt;i&gt;most&lt;/i&gt; of our customers take
advantage of this in one way or another. Some have custom authentication requirements,
some want to do special handling with posted data and others just want to log certain
activities. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Last year, we released our &lt;a href="http://www.qualitydata.com/solutions/pocket-pc-sharepoint.aspx"&gt;Sharepoint
Bridge&lt;/a&gt; which is a “shrink wrapped” provider to make our product work with Sharepoint
Portal Server and Windows Sharepoint Services and have attracted a lot of attention
from organizations that wanted an easy way to push mobile data into their existing
Sharepoint-based intranet. This extra capability can be customized and improved on
its own product cycle without ever affecting the functionality of the primary product.
And, as we upgrade our web service with additional features, our custom providers
continue to work.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Now easier than ever&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;With the release of the .Net Framework
2.0, Microsoft included a base provider class in the framework itself. &amp;nbsp;We were
able to dump all of our plumbing code and simply inherit our base classes from the
new &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;System.Configuration.Provider.ProviderBase &lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;class.&amp;nbsp;
The various configuration (ConfigurationSection, ProviderCollection, etc.) classes
have also been simplified, so we cleaned up our existing configuration code as well.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 1in"&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;There are plenty of articles
on MSDN and elsewhere on using the provider model, so it would be redundant for me
to go through all that here. In a future post, I plan provide a real working example
in case anyone wants a nice starter project.&lt;/span&gt;&lt;/i&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Not just for Asp.Net&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;With the release of Visual Studio
2005, Microsoft showed off the new Asp.Net Membership System in just about every presentation
they gave. Everyone was impressed with the instant login and user creation controls
and when Microsoft was asked the question “what if we want to change the implementation”,
they were able to point to the provider-based implementation of their Membership System.
Since there is such a high adoption rate of the Asp.Net Membership System, many folks
associate the term “provider” with the Role, Membership and Profile providers in Asp.Net.
Many programmers will go on to assume that this means the “AspNetSqlRoleProvider”,
“AspNetSqlMembershipProvider” and “AspNetProfileProvider” and lose sight of the fact
that these are just the default (if not the most common) implementations of the base
provider classes.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;More and more ISV’s are recognizing
that this model is not only useful for supporting unplanned circumstances but will
also become more in demand with the increased adoption rate of Microsoft’s development
platforms.&amp;nbsp; The investment is minimal and the potential rewards are significant.
As I evaluate new applications, I have gotten into the habit of reading the configuration
files and lately have seen an increased number of “shrink wrap” programs that have
some form of provider-based implementation. One good example is &lt;a href="http://communityserver.org/"&gt;Telligent’s
Community Server&lt;/a&gt; that appears to have largely been built on base provider classes.
I have not seen much documentation on this but I would assume that Telligent built
it this way so that organizations could swap out some of the implementation. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The provider model works well for
Asp.Net (web) applications since the appropriate provider is loaded once and based
on the settings in Web.Config. It also works well for WinForms applications, although
a change in the application’s configuration file does not automatically cause a running
application to restart and reload a different provider. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;From one ISV to another…&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So, if you are an ISV building solutions
on the Microsoft .Net platform, you owe it to yourself to consider a provider-based
implementation of your application. You’ll find you are able to satisfy many unexpected
requirements and not have to saddle your application with extra features that will
need to be optionally disabled in future releases.&amp;nbsp; Another big benefit is the
additional revenue stream you open up with new add-on products like your “Oracle Provider”
or “SAP Provider”.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I love this subject and, while I
have had a lot of success in actually using it, keep finding there is more to learn.
Your comments are welcome.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=98a72720-e617-4117-9ce7-db3482617e31" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,98a72720-e617-4117-9ce7-db3482617e31.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=61b7a2ee-5c95-40b8-af2b-9014586bf3c8</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,61b7a2ee-5c95-40b8-af2b-9014586bf3c8.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,61b7a2ee-5c95-40b8-af2b-9014586bf3c8.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=61b7a2ee-5c95-40b8-af2b-9014586bf3c8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p>
            <span style="FONT-SIZE: 10pt">I’ve been an Independent Software Vendor (ISV) since
1991 and have created marketable software products using various flavors of “xBase”
(dBase, FoxPro, Clipper) and eventually every version of Visual Basic since version
1.0.  I’ve loved every one of those development tools (except perhaps VB 4) and
built lots of great products, many that are still selling today. </span>
          </p>
          <p>
            <b>
              <span style="FONT-SIZE: 10pt">Then I discovered Microsoft .Net</span>
            </b>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">In spite of a decade of experience, I felt like I was
starting all over again. The learning curve was steep and I actually had to “unlearn”
a lot to understand totally new ways of doing common things.  It’s hard to spend
hours learning a new way of doing something when can “knock it out” in minutes the
old way.  I’ve been learning this technology for nearly five years and am still
discovering uncharted territories every day.</span>
          </p>
          <p>
            <b>
              <span style="FONT-SIZE: 10pt">Has it been worth it? You bet it has!</span>
            </b>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">I can now build products that run on a variety of platforms
and can be used online, offline and any time. I can do all of this in much less time
and with much less code. This means that there is less to go wrong and it is easier
to make changes.   All this adds up to improved Quality and increased customer
satisfaction. </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Moving forward, the next decade promises dramatic returns
on my investments. And with all the cool technology that Microsoft is planning, I
just know it is going to be a lot of fun.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Those who know me will laugh when I say (again) “this
is the best time to be a programmer”. – This time I really mean it!</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=61b7a2ee-5c95-40b8-af2b-9014586bf3c8" />
      </body>
      <title>Bite the bullet and invest in learning .Net</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,61b7a2ee-5c95-40b8-af2b-9014586bf3c8.aspx</guid>
      <link>http://mishler.net/2006/04/12/BiteTheBulletAndInvestInLearningNet.aspx</link>
      <pubDate>Wed, 12 Apr 2006 03:06:38 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I’ve been an Independent Software Vendor (ISV) since
1991 and have created marketable software products using various flavors of “xBase”
(dBase, FoxPro, Clipper) and eventually every version of Visual Basic since version
1.0. &amp;nbsp;I’ve loved every one of those development tools (except perhaps VB 4) and
built lots of great products, many that are still selling today. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt"&gt;Then I discovered Microsoft .Net&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;In spite of a decade of experience, I felt like I was
starting all over again. The learning curve was steep and I actually had to “unlearn”
a lot to understand totally new ways of doing common things. &amp;nbsp;It’s hard to spend
hours learning a new way of doing something when can “knock it out” in minutes the
old way. &amp;nbsp;I’ve been learning this technology for nearly five years and am still
discovering uncharted territories every day.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;&lt;span style="FONT-SIZE: 10pt"&gt;Has it been worth it? You bet it has!&lt;/span&gt;&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I can now build products that run on a variety of platforms
and can be used online, offline and any time. I can do all of this in much less time
and with much less code. This means that there is less to go wrong and it is easier
to make changes. &amp;nbsp;&amp;nbsp;All this adds up to improved Quality and increased customer
satisfaction. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Moving forward, the next decade promises dramatic returns
on my investments. And with all the cool technology that Microsoft is planning, I
just know it is going to be a lot of fun.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Those who know me will laugh when I say (again) “this
is the best time to be a programmer”. – This time I really mean it!&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=61b7a2ee-5c95-40b8-af2b-9014586bf3c8" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,61b7a2ee-5c95-40b8-af2b-9014586bf3c8.aspx</comments>
      <category>.Net</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=aba97dbb-7af8-48be-a1e9-b40800413b28</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,aba97dbb-7af8-48be-a1e9-b40800413b28.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,aba97dbb-7af8-48be-a1e9-b40800413b28.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=aba97dbb-7af8-48be-a1e9-b40800413b28</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I have a web application that requires
a modal “pop-up” window for collecting extra data from the user.  I have done
this in the past using JavaScript to open a new window but was wondering if Microsoft’s
Atlas library might have something to do this right “out of the box”.  I did
not find a specific method for doing anything like this but the </span>
            <b>
              <span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Lucida Console'">atlas:DragOverlayExtender</span>
            </b>
            <span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Lucida Console'"> and <b>atlas:UpdatePanel</b></span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> looked
like them might offer some functionality do get the job done.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <i>
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Don’t you always worry that there
is a one-line solution out there as you proceed to kludge something together?</span>
            </i>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"> 
I searched Google and read the Atlas Documentation and lots of blogs but could not
find something that did this. With my luck, someone will respond with “Oh, just…”</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Anyway, I have come up with an approach
that is not really modal (yet) but actually gives me ideas for some very interesting
possibilities. Essentially, I place a hidden panel, complete with all of the user
interface elements I need for collecting extra input, directly onto the form.  Now
this is not really exciting except that, with Atlas, I can show and hide the panel
without client-side javascript and without a post-back. Further, I can use server-side
code to process the data entered into the panel and update other controls on the web
form, again without a post-back.  So, while the example is fairly trivial, it
illustrates how Atlas can greatly simplify something that used to be a great pain
with lots of difficult-to-debug javascript. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This is what the page looks like
initially, with the input panel and finally with the collected data displayed. Note
that a postback is never required.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="326" src="http://brian.mishler.net/content/binary/image002.jpg" width="360" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This is what the solution looks
like:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="161" src="http://brian.mishler.net/content/binary/image003.jpg" width="202" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">And here is the code for default.aspx.
You can simply copy/paste this into a Visual Studio 2005 project that has the <b>Microsoft.Web.Atlas.dll </b>assembly
in its Bin folder as well as the requisite entries in web.config. (A ready-to-go project
is also available in a Zip file at the bottom of this post.)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'">&lt;%</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">@</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: maroon">Page</span>
              <span style="COLOR: red">Language</span>
              <span style="COLOR: blue">="VB"</span>
              <span style="BACKGROUND: yellow">%&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;!</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">DOCTYPE</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">html</span>
              <span style="COLOR: red">PUBLIC</span>
              <span style="COLOR: blue">"-//W3C//DTD
XHTML 1.0 Transitional//EN"</span>
              <span style="COLOR: blue">"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">script</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">runat</span>
              <span style="COLOR: blue">="server"&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">Protected</span><span style="COLOR: blue">Sub</span> btnPopup
Click(<span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> System.EventArgs)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: green">'
show Popup panel</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">CType</span>(<span style="COLOR: blue">Me</span>.popupUpdatePanel.FindControl(<span style="COLOR: maroon">"pnlPopup"</span>),
Panel).Visible = <span style="COLOR: blue">True</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">End</span><span style="COLOR: blue">Sub</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">Protected</span><span style="COLOR: blue">Sub</span> btnApply
Click(<span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> System.EventArgs)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: green">'
use FindControl to locate various controls</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Dim</span> txtName <span style="COLOR: blue">As</span> TextBox
= <span style="COLOR: blue">CType</span>(<span style="COLOR: blue">Me</span>.popupUpdatePanel.FindControl(<span style="COLOR: maroon">"txtName"</span>),
TextBox)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Dim</span> txtPhone <span style="COLOR: blue">As</span> TextBox
= <span style="COLOR: blue">CType</span>(<span style="COLOR: blue">Me</span>.popupUpdatePanel.FindControl(<span style="COLOR: maroon">"txtPhone"</span>),
TextBox)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Dim</span> lblResult <span style="COLOR: blue">As</span> Label
= <span style="COLOR: blue">CType</span>(<span style="COLOR: blue">Me</span>.popupUpdatePanel.FindControl(<span style="COLOR: maroon">"lblResult"</span>),
Label)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Try</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: green">'
This is Good Old Server Side code. We could look up database info, etc.</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">           
lblResult.Text = txtName.Text &amp; <span style="COLOR: maroon">", "</span> &amp;
txtPhone.Text</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">Catch</span> ex <span style="COLOR: blue">As</span> Exception</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">If</span> lblResult <span style="COLOR: blue">IsNot</span><span style="COLOR: blue">Nothing</span><span style="COLOR: blue">Then</span> lblResult.Text
= ex.Message</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">End</span><span style="COLOR: blue">Try</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: green">'
hide the panel</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">       
btnCancel Click(<span style="COLOR: blue">Nothing</span>, <span style="COLOR: blue">Nothing</span>)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">End</span><span style="COLOR: blue">Sub</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">Sub</span> btnCancel
Click(<span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> EventArgs)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: green">'
hide popup panel</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">CType</span>(<span style="COLOR: blue">Me</span>.popupUpdatePanel.FindControl(<span style="COLOR: maroon">"pnlPopup"</span>),
Panel).Visible = <span style="COLOR: blue">False</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">End</span><span style="COLOR: blue">Sub</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;/</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">script</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">html</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">xmlns</span>
              <span style="COLOR: blue">="http://www.w3.org/1999/xhtml"&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">head</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">runat</span>
              <span style="COLOR: blue">="server"&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">title</span><span style="COLOR: blue">&gt;</span>Untitled
Page<span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">title</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;/</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">head</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">body</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">form</span><span style="COLOR: red">id</span><span style="COLOR: blue">="form1"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">atlas</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">ScriptManager</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="ScriptManager1"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">EnablePartialRendering</span><span style="COLOR: blue">="true"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">div</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">atlas</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">UpdatePanel</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="popupUpdatePanel"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">Mode</span><span style="COLOR: blue">="Always"&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">ContentTemplate</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Panel</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="pnlPopup"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">Height</span><span style="COLOR: blue">="200px"</span><span style="COLOR: red">Width</span><span style="COLOR: blue">="300px"</span><span style="COLOR: red">BackColor</span><span style="COLOR: blue">="gainsboro"</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                        <span style="COLOR: red">Visible</span><span style="COLOR: blue">="false"</span><span style="COLOR: red">BorderColor</span><span style="COLOR: blue">="gray"</span><span style="COLOR: red">BorderStyle</span><span style="COLOR: blue">="Outset"</span><span style="COLOR: red">BorderWidth</span><span style="COLOR: blue">="2"&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                        <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">div</span><span style="COLOR: red">style</span><span style="COLOR: blue">="height:
10px; background-color: Blue; color: White; width: auto;"&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                           
Enter User Info<span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">div</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                       
Name: <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">TextBox</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="txtName"</span><span style="COLOR: blue">/&gt;&lt;</span><span style="COLOR: maroon">br</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                       
phone: <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">TextBox</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="txtPhone"</span><span style="COLOR: blue">/&gt;&lt;</span><span style="COLOR: maroon">br</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                        <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Button</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="btnApply"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="Server"</span><span style="COLOR: red">Text</span><span style="COLOR: blue">="Apply"</span><span style="COLOR: red">OnClick</span><span style="COLOR: blue">="btnApply
Click"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                        <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Button</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="btnCancel"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="Server"</span><span style="COLOR: red">OnClick</span><span style="COLOR: blue">="btnCancel
Click"</span><span style="COLOR: red">Text</span><span style="COLOR: blue">="Cancel"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                    <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Panel</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Button</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="btnPopup"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: red">Text</span><span style="COLOR: blue">="Prompt
for User Info"</span><span style="COLOR: red">OnClick</span><span style="COLOR: blue">="btnPopup
Click"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">asp</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">Label</span><span style="COLOR: red">ID</span><span style="COLOR: blue">="lblResult"</span><span style="COLOR: red">runat</span><span style="COLOR: blue">="server"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">ContentTemplate</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">Triggers</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">atlas</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">ControlEventTrigger</span><span style="COLOR: red">ControlID</span><span style="COLOR: blue">="btnPopup"</span><span style="COLOR: red">EventName</span><span style="COLOR: blue">="Click"</span><span style="COLOR: blue">/&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">                <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">Triggers</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">atlas</span><span style="COLOR: blue">:</span><span style="COLOR: maroon">UpdatePanel</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">div</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">form</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">&lt;</span><span style="COLOR: maroon">script</span><span style="COLOR: red">type</span><span style="COLOR: blue">="text/xml-script"&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        </span>
            <span lang="FR" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&lt;page
xmlns:script=<span style="COLOR: maroon">"http://schemas.microsoft.com/xml-script/2005"</span>&gt;</span>
          </p>
          <p class="MsoNormal">
            <span lang="FR" style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            </span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">&lt;references&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">           
&lt;/references&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">           
&lt;components&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">           
&lt;/components&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">       
&lt;/page&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">script</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;/</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">body</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;/</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">html</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This is my foray into Atlas and,
as someone who has done a good bit of client-side javascript, I am quick to jump on
the Atlas band-wagon. I actually hope there is or will be an &lt;Atlas:ModalPanel..&gt;
control but if not, I can already see where the basic controls provided in the March
CTP can be used to do some interesting stuff. So if anyone knows of the “one liner”…
please let me know.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <p>
Download: <a href="http://brian.mishler.net/content/binary/AtlasWebSite1.zip">AtlasWebSite1.zip</a><br /></p>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=aba97dbb-7af8-48be-a1e9-b40800413b28" />
      </body>
      <title>Displaying a pop-up data entry screen with Asp.Net Atlas</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,aba97dbb-7af8-48be-a1e9-b40800413b28.aspx</guid>
      <link>http://mishler.net/2006/04/11/DisplayingAPopupDataEntryScreenWithAspNetAtlas.aspx</link>
      <pubDate>Tue, 11 Apr 2006 02:15:10 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;I have a web application that requires
a modal “pop-up” window for collecting extra data from the user.&amp;nbsp; I have done
this in the past using JavaScript to open a new window but was wondering if Microsoft’s
Atlas library might have something to do this right “out of the box”. &amp;nbsp;I did
not find a specific method for doing anything like this but the &lt;/span&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Lucida Console'"&gt;atlas:DragOverlayExtender&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 8pt; FONT-FAMILY: 'Lucida Console'"&gt; and &lt;b&gt;atlas:UpdatePanel&lt;/b&gt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt; looked
like them might offer some functionality do get the job done.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Don’t you always worry that there
is a one-line solution out there as you proceed to kludge something together?&lt;/span&gt;&lt;/i&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&amp;nbsp;
I searched Google and read the Atlas Documentation and lots of blogs but could not
find something that did this. With my luck, someone will respond with “Oh, just…”&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Anyway, I have come up with an approach
that is not really modal (yet) but actually gives me ideas for some very interesting
possibilities. Essentially, I place a hidden panel, complete with all of the user
interface elements I need for collecting extra input, directly onto the form. &amp;nbsp;Now
this is not really exciting except that, with Atlas, I can show and hide the panel
without client-side javascript and without a post-back. Further, I can use server-side
code to process the data entered into the panel and update other controls on the web
form, again without a post-back.&amp;nbsp; So, while the example is fairly trivial, it
illustrates how Atlas can greatly simplify something that used to be a great pain
with lots of difficult-to-debug javascript. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is what the page looks like
initially, with the input panel and finally with the collected data displayed. Note
that a postback is never required.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=326 src="http://brian.mishler.net/content/binary/image002.jpg" width=360&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is what the solution looks
like:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=161 src="http://brian.mishler.net/content/binary/image003.jpg" width=202&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;And here is the code for default.aspx.
You can simply copy/paste this into a Visual Studio 2005 project that has the &lt;b&gt;Microsoft.Web.Atlas.dll &lt;/b&gt;assembly
in its Bin folder as well as the requisite entries in web.config. (A ready-to-go project
is also available in a Zip file at the bottom of this post.)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;@&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: maroon"&gt;Page&lt;/span&gt; &lt;span style="COLOR: red"&gt;Language&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="VB"&lt;/span&gt; &lt;span style="BACKGROUND: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;!&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;DOCTYPE&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;html&lt;/span&gt; &lt;span style="COLOR: red"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: blue"&gt;"-//W3C//DTD
XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;script&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; btnPopup
Click(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.EventArgs)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'
show Popup panel&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.popupUpdatePanel.FindControl(&lt;span style="COLOR: maroon"&gt;"pnlPopup"&lt;/span&gt;),
Panel).Visible = &lt;span style="COLOR: blue"&gt;True&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Protected&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; btnApply
Click(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.EventArgs)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'
use FindControl to locate various controls&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; txtName &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; TextBox
= &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.popupUpdatePanel.FindControl(&lt;span style="COLOR: maroon"&gt;"txtName"&lt;/span&gt;),
TextBox)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; txtPhone &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; TextBox
= &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.popupUpdatePanel.FindControl(&lt;span style="COLOR: maroon"&gt;"txtPhone"&lt;/span&gt;),
TextBox)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Dim&lt;/span&gt; lblResult &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Label
= &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.popupUpdatePanel.FindControl(&lt;span style="COLOR: maroon"&gt;"lblResult"&lt;/span&gt;),
Label)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'
This is Good Old Server Side code. We could look up database info, etc.&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
lblResult.Text = txtName.Text &amp;amp; &lt;span style="COLOR: maroon"&gt;", "&lt;/span&gt; &amp;amp;
txtPhone.Text&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Catch&lt;/span&gt; ex &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; Exception&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;If&lt;/span&gt; lblResult &lt;span style="COLOR: blue"&gt;IsNot&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Then&lt;/span&gt; lblResult.Text
= ex.Message&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Try&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'
hide the panel&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
btnCancel Click(&lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;Nothing&lt;/span&gt;)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; btnCancel
Click(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; EventArgs)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: green"&gt;'
hide popup panel&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;CType&lt;/span&gt;(&lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.popupUpdatePanel.FindControl(&lt;span style="COLOR: maroon"&gt;"pnlPopup"&lt;/span&gt;),
Panel).Visible = &lt;span style="COLOR: blue"&gt;False&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;script&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;html&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="http://www.w3.org/1999/xhtml"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;head&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;Untitled
Page&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;head&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;form&lt;/span&gt; &lt;span style="COLOR: red"&gt;id&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;atlas&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="ScriptManager1"&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 style="COLOR: red"&gt;EnablePartialRendering&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;div&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;atlas&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="popupUpdatePanel"&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 style="COLOR: red"&gt;Mode&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Always"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Panel&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="pnlPopup"&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 style="COLOR: red"&gt;Height&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="200px"&lt;/span&gt; &lt;span style="COLOR: red"&gt;Width&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="300px"&lt;/span&gt; &lt;span style="COLOR: red"&gt;BackColor&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="gainsboro"&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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 style="COLOR: red"&gt;Visible&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="false"&lt;/span&gt; &lt;span style="COLOR: red"&gt;BorderColor&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="gray"&lt;/span&gt; &lt;span style="COLOR: red"&gt;BorderStyle&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Outset"&lt;/span&gt; &lt;span style="COLOR: red"&gt;BorderWidth&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="2"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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 style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;div&lt;/span&gt; &lt;span style="COLOR: red"&gt;style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="height:
10px; background-color: Blue; color: White; width: auto;"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
Enter User Info&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;div&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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;
Name: &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;TextBox&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 style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="txtName"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;br&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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;
phone: &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;TextBox&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 style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="txtPhone"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;br&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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 style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Button&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnApply"&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 style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Apply"&lt;/span&gt; &lt;span style="COLOR: red"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnApply
Click"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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 style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Button&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnCancel"&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 style="COLOR: red"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnCancel
Click"&lt;/span&gt; &lt;span style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Cancel"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Panel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Button&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnPopup"&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 style="COLOR: red"&gt;Text&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Prompt
for User Info"&lt;/span&gt; &lt;span style="COLOR: red"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnPopup
Click"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;asp&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Label&lt;/span&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="lblResult"&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 style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;atlas&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;ControlEventTrigger&lt;/span&gt; &lt;span style="COLOR: red"&gt;ControlID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="btnPopup"&lt;/span&gt; &lt;span style="COLOR: red"&gt;EventName&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Click"&lt;/span&gt; &lt;span style="COLOR: blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&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; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;atlas&lt;/span&gt;&lt;span style="COLOR: blue"&gt;:&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;div&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;form&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;script&lt;/span&gt; &lt;span style="COLOR: red"&gt;type&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="text/xml-script"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;page
xmlns:script=&lt;span style="COLOR: maroon"&gt;"http://schemas.microsoft.com/xml-script/2005"&lt;/span&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&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="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;references&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/references&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;components&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/components&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/page&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;script&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;body&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;html&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is my foray into Atlas and,
as someone who has done a good bit of client-side javascript, I am quick to jump on
the Atlas band-wagon. I actually hope there is or will be an &amp;lt;Atlas:ModalPanel..&amp;gt;
control but if not, I can already see where the basic controls provided in the March
CTP can be used to do some interesting stuff. So if anyone knows of the “one liner”…
please let me know.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
Download: &lt;a href="http://brian.mishler.net/content/binary/AtlasWebSite1.zip"&gt;AtlasWebSite1.zip&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=aba97dbb-7af8-48be-a1e9-b40800413b28" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,aba97dbb-7af8-48be-a1e9-b40800413b28.aspx</comments>
      <category>Asp.Net Atlas</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=d007f698-1c2f-467b-b765-b9da65e7f830</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,d007f698-1c2f-467b-b765-b9da65e7f830.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,d007f698-1c2f-467b-b765-b9da65e7f830.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=d007f698-1c2f-467b-b765-b9da65e7f830</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">In an earlier blog, I mentioned
how through the use of Dynamic MasterPages, I could have my web site change its format
based on some arbitrary condition such as the browser type. Here, I have assembled
an example to illustrate Dynamic MasterPages in action. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">For this sample, I have created
a single web form that contains our page content. This form (childPage.aspx) gets
its layout from a master page (masterpage1.master) but when a particular condition
is encountered (query parameter “foo” provided), the child will use the layout from
a different master page (masterpage2.master).</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Since we might have dozens of pages
that need to dynamically change their layout, I have created a class called “WebFormBase”
that inherits from System.Web.UI.Form and as I add each new web form, I will have
it inherit from my custom base class rather than from the default System.Web.UI.Form.
Now when I add code into “WebFormBase”, my child form (and any other forms that derive
from “WebFormBase”) will enjoy that code.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This is a good practice, especially
in large web sites, for many obvious reasons.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">To load our “childPage” with different
query parameters, I created “default.aspx” with two hyperlinks. </span>
          </p>
          <ol style="MARGIN-TOP: 0in" type="1">
            <li class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The first hyperlink loads “childPage.aspx”
with no query parameters.</span>
            </li>
            <li class="MsoNormal">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The second hyperlink loads “childPage.aspx”
with the query parameter, “foo”.</span>
            </li>
          </ol>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">This figure illustrates how the
same child page looks when different (dynamic) master pages are applied:</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
              <img height="421" src="http://brian.mishler.net/content/binary/image001123.gif" width="400" />
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Here is my custom base class, WebFormBase,
into which I have added a single event handler to check for the “foo” querystring
parameter.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">public</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: blue">class</span>
              <span style="COLOR: teal">WebFormBase</span> :
System.Web.UI.<span style="COLOR: teal">Page</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">{</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    <span style="COLOR: blue">protected</span><span style="COLOR: blue">override</span><span style="COLOR: blue">void</span> OnPreInit(<span style="COLOR: teal">EventArgs</span> e)</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    {</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">base</span>.OnPreInit(e);</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">if</span> (Request.QueryString.Get(<span style="COLOR: maroon">"foo"</span>)
== <span style="COLOR: blue">null</span>){</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">this</span>.MasterPageFile=<span style="COLOR: maroon">"~/MasterPage1.master"</span>;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">       
}</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">        <span style="COLOR: blue">else</span>{</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">            <span style="COLOR: blue">this</span>.MasterPageFile=<span style="COLOR: maroon">"~/MasterPage2.master"</span>;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">       
}</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">    }</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">}</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The following code is for “ChildPage.aspx”,
the web page whose layout is controlled by the two master pages. Notice that the MasterPageFile
attribute is initially defined as “MasterPage1.master” and also that <b>Inherits=”WebFormBase”</b> causes
the web form to inherit from our custom class rather than the built in webforms base
class. </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'">&lt;%</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">@</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: maroon">Page</span>
              <span style="COLOR: red">Language</span>
              <span style="COLOR: blue">="C#"</span>
              <span style="COLOR: red">MasterPageFile</span>
              <span style="COLOR: blue">="~/MasterPage1.master"</span>
              <span style="COLOR: red">Title</span>
              <span style="COLOR: blue">="Variable
Page"</span>
              <span style="COLOR: red">Inherits</span>
              <span style="COLOR: blue">="WebFormBase"</span>
              <span style="BACKGROUND: yellow">%&gt;</span>
            </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">asp</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">:</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">Content</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">ID</span>
              <span style="COLOR: blue">="foo"</span>
              <span style="COLOR: red">ContentPlaceHolderID</span>
              <span style="COLOR: blue">="ContentPlaceHolder1"</span>
              <span style="COLOR: red">runat</span>
              <span style="COLOR: blue">="server"&gt;</span>
            </span>
          </p>
          <p class="MsoNormal" style="MARGIN-LEFT: 0.5in">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">div</span>
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'">
              <span style="COLOR: red">style</span>
              <span style="COLOR: blue">="background-color:White;padding:10px
10px 10px 10px"&gt;<br /></span>This is the content that is embedded in the child page. Depending on the dynamically
selected master page, my surroundings may differ.<br /><span style="COLOR: blue">&lt;/</span><span style="COLOR: maroon">div</span><span style="COLOR: blue">&gt;</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&lt;/</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">asp</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">:</span>
            <span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'">Content</span>
            <span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'">&gt;</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">One final note is that since I have
defined that <b>ContentPlaceHolderID=”ContentPlaceHolder1”</b>, the alternate master
page must have a content place holder named “ContentPlaceHolder1” or the page will
erupt at runtime.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Feel free to download and run the
sample web site which is available as a Zip file near the bottom of this post. As
always, any comments and opinions are appreciated.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <p>
Download: <a href="http://brian.mishler.net/content/binary/DynamicMasterPageSample.zip">DynamicMasterPageSample.zip</a><br /></p>
        <a href="http://brian.mishler.net/content/binary/DynamicMasterPageSample.zip">DynamicMasterPageSample.zip
(2.51 KB)</a>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=d007f698-1c2f-467b-b765-b9da65e7f830" />
      </body>
      <title>Dynamic MasterPages, Part 2</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,d007f698-1c2f-467b-b765-b9da65e7f830.aspx</guid>
      <link>http://mishler.net/2006/04/10/DynamicMasterPagesPart2.aspx</link>
      <pubDate>Mon, 10 Apr 2006 04:18:29 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;In an earlier blog, I mentioned
how through the use of Dynamic MasterPages, I could have my web site change its format
based on some arbitrary condition such as the browser type. Here, I have assembled
an example to illustrate Dynamic MasterPages in action. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;For this sample, I have created
a single web form that contains our page content. This form (childPage.aspx) gets
its layout from a master page (masterpage1.master) but when a particular condition
is encountered (query parameter “foo” provided), the child will use the layout from
a different master page (masterpage2.master).&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Since we might have dozens of pages
that need to dynamically change their layout, I have created a class called “WebFormBase”
that inherits from System.Web.UI.Form and as I add each new web form, I will have
it inherit from my custom base class rather than from the default System.Web.UI.Form.
Now when I add code into “WebFormBase”, my child form (and any other forms that derive
from “WebFormBase”) will enjoy that code.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This is a good practice, especially
in large web sites, for many obvious reasons.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;To load our “childPage” with different
query parameters, I created “default.aspx” with two hyperlinks. &lt;/span&gt;
&lt;/p&gt;
&lt;ol style="MARGIN-TOP: 0in" type=1&gt;
&lt;li class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The first hyperlink loads “childPage.aspx”
with no query parameters.&lt;/span&gt; 
&lt;li class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The second hyperlink loads “childPage.aspx”
with the query parameter, “foo”.&lt;/span&gt; 
&lt;/li&gt;
&lt;/ol&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;This figure illustrates how the
same child page looks when different (dynamic) master pages are applied:&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;img height=421 src="http://brian.mishler.net/content/binary/image001123.gif" width=400&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Here is my custom base class, WebFormBase,
into which I have added a single event handler to check for the “foo” querystring
parameter.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;public&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: blue"&gt;class&lt;/span&gt; &lt;span style="COLOR: teal"&gt;WebFormBase&lt;/span&gt; :
System.Web.UI.&lt;span style="COLOR: teal"&gt;Page&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;{&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;protected&lt;/span&gt; &lt;span style="COLOR: blue"&gt;override&lt;/span&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; OnPreInit(&lt;span style="COLOR: teal"&gt;EventArgs&lt;/span&gt; e)&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;base&lt;/span&gt;.OnPreInit(e);&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;if&lt;/span&gt; (Request.QueryString.Get(&lt;span style="COLOR: maroon"&gt;"foo"&lt;/span&gt;)
== &lt;span style="COLOR: blue"&gt;null&lt;/span&gt;){&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.MasterPageFile=&lt;span style="COLOR: maroon"&gt;"~/MasterPage1.master"&lt;/span&gt;;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;else&lt;/span&gt;{&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="COLOR: blue"&gt;this&lt;/span&gt;.MasterPageFile=&lt;span style="COLOR: maroon"&gt;"~/MasterPage2.master"&lt;/span&gt;;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt;}&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The following code is for “ChildPage.aspx”,
the web page whose layout is controlled by the two master pages. Notice that the MasterPageFile
attribute is initially defined as “MasterPage1.master” and also that &lt;b&gt;Inherits=”WebFormBase”&lt;/b&gt; causes
the web form to inherit from our custom class rather than the built in webforms base
class. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; BACKGROUND: yellow; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;@&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: maroon"&gt;Page&lt;/span&gt; &lt;span style="COLOR: red"&gt;Language&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="C#"&lt;/span&gt; &lt;span style="COLOR: red"&gt;MasterPageFile&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="~/MasterPage1.master"&lt;/span&gt; &lt;span style="COLOR: red"&gt;Title&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="Variable
Page"&lt;/span&gt; &lt;span style="COLOR: red"&gt;Inherits&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="WebFormBase"&lt;/span&gt; &lt;span style="BACKGROUND: yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;asp&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Content&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;ID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="foo"&lt;/span&gt; &lt;span style="COLOR: red"&gt;ContentPlaceHolderID&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="ContentPlaceHolder1"&lt;/span&gt; &lt;span style="COLOR: red"&gt;runat&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal style="MARGIN-LEFT: 0.5in"&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;div&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'"&gt; &lt;span style="COLOR: red"&gt;style&lt;/span&gt;&lt;span style="COLOR: blue"&gt;="background-color:White;padding:10px
10px 10px 10px"&amp;gt;&lt;br&gt;
&lt;/span&gt;This is the content that is embedded in the child page. Depending on the dynamically
selected master page, my surroundings may differ.&lt;br&gt;
&lt;span style="COLOR: blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;div&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;asp&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;:&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: maroon; FONT-FAMILY: 'Courier New'"&gt;Content&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;One final note is that since I have
defined that &lt;b&gt;ContentPlaceHolderID=”ContentPlaceHolder1”&lt;/b&gt;, the alternate master
page must have a content place holder named “ContentPlaceHolder1” or the page will
erupt at runtime.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Feel free to download and run the
sample web site which is available as a Zip file near the bottom of this post. As
always, any comments and opinions are appreciated.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;
Download: &lt;a href="http://brian.mishler.net/content/binary/DynamicMasterPageSample.zip"&gt;DynamicMasterPageSample.zip&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;a href="http://brian.mishler.net/content/binary/DynamicMasterPageSample.zip"&gt;DynamicMasterPageSample.zip
(2.51 KB)&lt;/a&gt;&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=d007f698-1c2f-467b-b765-b9da65e7f830" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,d007f698-1c2f-467b-b765-b9da65e7f830.aspx</comments>
      <category>Asp.Net</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=003dc4ae-d649-47f2-a019-7be1321a2f06</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,003dc4ae-d649-47f2-a019-7be1321a2f06.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,003dc4ae-d649-47f2-a019-7be1321a2f06.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=003dc4ae-d649-47f2-a019-7be1321a2f06</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>Using existing Asp.Net Membership data with CommunityServer</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,003dc4ae-d649-47f2-a019-7be1321a2f06.aspx</guid>
      <link>http://mishler.net/2006/04/10/UsingExistingAspNetMembershipDataWithCommunityServer.aspx</link>
      <pubDate>Mon, 10 Apr 2006 02:12:06 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I really like the new Version 2.0 of CommunityServer
and have been trying to figure out how to best integrate it with my existing web site.
Since I already have several thousand members registered on my site, I would like
to either migrate their data into Community Server or find a clean way to share authentication
information so my existing members do not have to maintain separate passwords for
the existing customer-service and new community server functions. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I figured I would ask Telligent about the Asp.Net Forms
Authentication Module for CommunityServer so I initiated contact with their Sales
team. While I waited for a response, I decided to open up the database and figure
out what is going on inside. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;table class=MsoNormalTable cellspacing=0 cellpadding=0 border=0&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 0in; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; PADDING-TOP: 0in"&gt;
&lt;p class=MsoNormal style="MARGIN-BOTTOM: 12pt"&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The first thing I noticed was that the CommunityServer
database includes the tables and stored procedures used by the AspNet membership system.
These include AspNet Applications, AspNet Membership, AspNet Profile, AspNet Users
and several more.&amp;nbsp;&lt;br&gt;
&lt;br&gt;
A quick look at web.config confirmed that CommunityServer has created custom providers
that (presumably) inherit from SQLMembershipProvider, SQLRoleProvider and SQLProfileProvider.&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 0in; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; PADDING-TOP: 0in"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=293 src="http://brian.mishler.net/content/binary/image00112.gif" width=208 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I really like the fact that CommunityServer leverages
the AspNet membership providers for generic mainstream authentication functions. I
believe this is a trend we will see more of now that Microsoft has established a de-facto
standard. Telligent has done the smart thing by extending the base providers with
their own customized versions that provide application-specific functionality and
utilize additional data tables. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;With hopes of sharing common membership information,
I set out to understand the extra information required by CommunityServer for records
that were initiated from my own system.&amp;nbsp; After a bit of trial and error I found
that CommunityServer expects each user to be a member of the "everyone" role in the
AspNet membership system and that a record is required for each member in the cs users
and cs profiles tables which maintain Community-server specific informaiton on each
member.&amp;nbsp; At this point, I was feeling pretty confident about my chances of sharing
CommunityServer's membership system with my own, so I imported my own data into the
CommunityServer database. After doing so, I was able to log into CommunityServer with
one of my imported user accounts and I figured I was done.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Knowing a thing or two about Asp.Net providers, I reset
the "ApplicationName" attribute for each of the three providers (SqlProfileProvider,
SqlRoleProvider and SqlMembershipProvider) in my own application's web.config.&amp;nbsp;
This would need to be "dev" in order that any new records created by my system would
wind up with the same ApplicationID that is used by CommunityServer's providers.&amp;nbsp;
Finally, I changed my connection string to point over to CommunityServer and then
"let 'er rip".&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Curses! It didn't work. My application was dead and
I was being told that &lt;/span&gt;&lt;em&gt;Procedure or function aspnet Membership GetPasswordWithFormat
has too many arguments specified. &lt;/em&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Hmmm. I remember this. It was the same error message
I got when I upgraded from the .Net 2.0 Beta to the live version last October.&amp;nbsp;
Sure enough, as I looked into it a little more, I found that CommunityServer 2.0 is
shipping with the beta versions of the Asp.Net membership providers. A lot of early
adopters will remember this situation: Microsoft told us that they reserved the right
to change the product prior to final release--and they did. The membership tables
did not change but many of the stored procedures did.&amp;nbsp; For the folks that built
sites with the basic providers, the issue was easily resolved with the AspNet regSql
utility that comes with the framework. (It can be found at c:\windows\microsoft.net\framework\v2.0.50727\aspnet
regsql.exe.)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Here are (most of) the differences:&lt;/span&gt;
&lt;/p&gt;
&lt;table class=MsoNormalTable cellpadding=0 border=0&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;Stored Procedure&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;Beta Version Parameters&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;Version 2.0 Parameters&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Membership GetPasswordWithFormat&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName NVARCHAR(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName nvarchar(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=3&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or function
aspnet Membership GetPasswordWithFormat has too many arguments specified&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;?XML:NAMESPACE PREFIX = O /&gt;@UserName NVARCHAR(256)&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastLoginActivityDate bit&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Membership UpdateUserInfo&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName NVARCHAR(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName nvarchar(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=6&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or function
aspnet Membership UpdateUserInfo has too many arguments specified&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName NVARCHAR(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@IsPasswordCorrect BIT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@IsPasswordCorrect bit&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastLoginActivityDate BIT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastLoginActivityDate bit&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@MaxInvalidPasswordAttempts INT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@MaxInvalidPasswordAttempts int&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordAttemptWindow INT &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordAttemptWindow int&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@TimeZoneAdjustment INT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@LastLoginDate datetime&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@LastActivityDate datetime&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Profile GetProperties&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName NVARCHAR(256) &amp;nbsp;&amp;nbsp; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName nvarchar(256&amp;nbsp; 
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=3&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or Function
'aspnet Profile GetProperties' expects parameter '@TimeZoneAdjustment', which was
not supplied&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName NVARCHAR(256) &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName nvarchar(256) &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@TimeZoneAdjustment INT&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Membership GetUserByName&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName NVARCHAR(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName nvarchar(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=3&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or Function
'aspnet Membership GetUserByName' expects parameter '@TimeZoneAdjustment', which was
not supplied&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName NVARCHAR(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@TimeZoneAdjustment INT &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime,&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastActivity &amp;nbsp; BIT = 0&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastActivity bit = 0&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Membership GetUserByUserId&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@UserId UNIQUEIDENTIFIER &amp;nbsp;&amp;nbsp; 
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;@UserId uniqueidentifier
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=3&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or Function
'aspnet Membership GetUserByUserId' expects parameter '@TimeZoneAdjustment', which
was not supplied&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@TimeZoneAdjustment INT &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastActivity BIT = 0&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UpdateLastActivity bit = 0&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt;aspnet Membership CreateUser&lt;/span&gt;&lt;/strong&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName NVARCHAR(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
@ApplicationName nvarchar(256)
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt" rowspan=5&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Provider Exception: &lt;/span&gt;&lt;em&gt;Procedure or Function
'aspnet Membership CreateUser' expects parameter '@TimeZoneAdjustment', which was
not supplied&lt;/em&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName NVARCHAR(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserName nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@Password NVARCHAR(128) &amp;nbsp;&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@Password nvarchar(128)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordSalt NVARCHAR(128)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordSalt nvarchar(128)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@Email NVARCHAR(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@Email nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordQuestion NVARCHAR(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordQuestion nvarchar(256)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordAnswer NVARCHAR(128)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordAnswer nvarchar(128)&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@IsApproved BIT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@IsApproved bit&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@TimeZoneAdjustment INT&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CurrentTimeUtc datetime&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CreateDate DATETIME = NULL&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@CreateDate datetime = NULL&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UniqueEmail INT = 0&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UniqueEmail int = 0&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordFormat INT = 0&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@PasswordFormat int = 0&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserId UNIQUEIDENTIFIER OUTPUT&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;td style="PADDING-RIGHT: 3pt; PADDING-LEFT: 3pt; PADDING-BOTTOM: 3pt; PADDING-TOP: 3pt"&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;@UserId uniqueidentifier OUTPUT&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;If you built a custom providers for the beta-version
of Asp.Net, a code change would be required to work with the released version of the
schema. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;At first glance, it appeared that Telligent overlooked
the change, but as I performed additional research, I found that their released version
was designed to provide default backward compatibility with their original (.Net 1.1)
product but also an upgrade path for the folks that want compatibility with the Asp.Net
2.0 Membership System. The CommunityServer 2.0 SDK (&lt;a href="http://communityserver.org/files/40/releases/entry516270.aspx"&gt;http://communityserver.org/files/40/releases/entry516270.aspx&lt;/a&gt;)
includes a readme.txt file that explains what they did and why they did it.&amp;nbsp;
In that document, they explain that "Telligent will be providing both Framework 1.1
and 2.0 compatible binaries."&amp;nbsp; You can update the binaries (dll) files and also
run a script which will update the Schema, but at the expense of 1.1 compatibility.&amp;nbsp;
The readme.txt goes on to explain how to replace the web.config and communityserver.config
files and also how to locate the SQL Script file that may be used to upgrade the default
schema to that of Asp.Net 2.0.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I am not sure why Beta versions of the Asp.Net schema
are involved at all, however, to utilize the final Asp.Net 2.0 database Schema, you
need to do the following:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;1. Substitute CommunityServer.ASPNet20MemberRole.dll
for CommunityServer.MemberRole.dll in the \bin folder&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;2. Modify CommunityServer.config to have the MemberRoleProfileProvider
use classes from the new dll. (swap out the config file)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;3. Swap out the provided web.config file for the one
in the SDK. (not sure of the differences)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;4. Update the database schema using their provided script.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;-- The only thing left is to get the ASPNet20MemberRole.dll&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Once I do these things, I am hopeful that I will have
a database schema that works with the "vanilla" Asp.Net providers. If I can get all
this to work, then I should be able to share my membership with that of CommunityServer.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;With all respect due to the great folks at Telligent,
I would like to suggest that they update the default installation (for new users)
to incorporate the released version of the Asp.Net membership schema which should
now be considered the gold standard. I believe there are plenty of folks that might
wish to unify their membership database with that of CommunityServer and it can be
a very easy process if the database schema is consistent.&amp;nbsp; If anyone knows more
or has insight on this subject, I invite your suggestions and comments. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=003dc4ae-d649-47f2-a019-7be1321a2f06" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,003dc4ae-d649-47f2-a019-7be1321a2f06.aspx</comments>
      <category>CommunityServer</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=89850ecb-7936-4d4c-a9dc-61178a3f3e45</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,89850ecb-7936-4d4c-a9dc-61178a3f3e45.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,89850ecb-7936-4d4c-a9dc-61178a3f3e45.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=89850ecb-7936-4d4c-a9dc-61178a3f3e45</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">So in <a href="http://brian.mishler.net/PermaLink,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx">another
blog</a>, I mentioned a technique where I could hide obsolete content throughout my
site by simply placing ContentPlaceHolders into hidden panels in the MasterPage.  In
that context, this practice might be a temporary fix pending a visit to each page
in the web site.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Since our business involves a lot
of mobility and we invite customers to visit our web site from their pocket pc, I’ve
been thinking that this technique of "hiding" content placeholders might offer a better
way to create a Pocket PC friendly user experience.  </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Currently, I substitute the
CSS file or even redirect the user to a special section of my web site whenever I
detect they are using Pocket IE. You can see this in action if you visit <a href="http://www.pocketforms.net/">http://www.pocketforms.net</a> (first
in your browser then from your pocket pc.) </span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">With Dynamic MasterPages, I can
programmatically select a specific master page based on the requestor's browser
type.  The pocket pc (or smartphone) master page, for example, can reference
a style sheet (.CSS file) which is appropriate for the device and also hide superfluous
ContentPlaceHolders such as banners and advertising.  This approach works much
better than a pure CSS approach since hidden content is omitted server-side and never
sent to the client.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">The following code was inspired
by <a href="blogs.msdn.com/keiths">Keith Smith's</a> presentation at the <a href="http://www.onetug.org/">Orlando
.Net User Group</a> and can be used to programmatically switch to the Pocket PC friendly
master page when a "Windows CE" (pocket pc) browser is detected.  In the following
code, the master page, pocketpc.master, changes the layout, hides some of the content
and references a CSS file with fonts and layout which are better suited for the smaller
form factor of a pocket pc.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: blue">protected</span>
            <span style="FONT-SIZE: 10pt">
              <span style="COLOR: blue">void</span> Page
PreInit(<span style="COLOR: blue">object</span> sender, <span style="COLOR: teal">EventArgs</span> e)
{<br /><span style="COLOR: blue">    if</span>(Request.Browser.Browser.ToLower.Contains(<span style="COLOR: maroon">"windows
ce")){<br /></span><span style="COLOR: blue">        this</span><span style="COLOR: maroon">.MasterPageFile
= "~/pocketpc.master";<br />
        }<br /></span><span style="COLOR: blue">        else</span> {<br /><span style="COLOR: blue">        this</span>.MasterPageFile
= <span style="COLOR: maroon">"~/MasterPage.master"</span>;<br />
    }<br />
}</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">In VB.Net, it looks like this:</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: blue">Protected</span>
            <span style="FONT-SIZE: 10pt">
              <span style="COLOR: blue">Sub</span> Page
PreInit(<span style="COLOR: blue">ByVal</span> sender <span style="COLOR: blue">As</span><span style="COLOR: blue">Object</span>, <span style="COLOR: blue">ByVal</span> e <span style="COLOR: blue">As</span> System.EventArgs) <span style="COLOR: blue">Handles</span><span style="COLOR: blue">Me</span>.PreInit<br /><span style="COLOR: blue">    If</span> Request.Browser.Browser.ToLower.Contains(<span style="COLOR: maroon">"windows
ce"</span>) <span style="COLOR: blue">Then<br />
        Me</span>.MasterPageFile = <span style="COLOR: maroon">"~\pocketpc.master"<br /></span><span style="COLOR: blue">    Else<br />
        Me</span>.MasterPageFile = <span style="COLOR: maroon">"~\MasterPage.master"<br /></span><span style="COLOR: blue">    End</span><span style="COLOR: blue">If<br />
End</span><span style="COLOR: blue">Sub</span></span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Notice that the opportunity to swap
out the MasterPageFile occurs in the PreInit method which occurs early in the page
lifecycle (before any custom controls are loaded.) This means that the code cannot
be placed into a web custom control (which would be really convenient) but, instead
must be placed into the inline code or code-behind file of each page. </span>
            <br />
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Rather than adding this code to
each page, this begs for a technique you always hear Carl Franklin, Richard Campbell
and their guests talking about on <a href="http://www.dotnetrocks.com/">.Net
Rocks</a>. That is, to have all your web forms inherit from a custom class rather
than from the default, System.Web.UI.Page. When you add behaviors such as variable
MasterPages to your custom page class, then all of your (derived) web forms will inherit
that behavior as well.  Since each of my pages inherit from a class called “webFormBase”,
I simply added the code into the Page PreInit event within webFormBase and I get automatic
master page switching.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Watch for another blog on this subject
for a generic sample of this in action.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=89850ecb-7936-4d4c-a9dc-61178a3f3e45" />
      </body>
      <title>Dynamic Master Pages</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,89850ecb-7936-4d4c-a9dc-61178a3f3e45.aspx</guid>
      <link>http://mishler.net/2006/04/10/DynamicMasterPages.aspx</link>
      <pubDate>Mon, 10 Apr 2006 01:21:53 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;So in &lt;a href="http://brian.mishler.net/PermaLink,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx"&gt;another
blog&lt;/a&gt;, I mentioned a technique where I could hide obsolete content throughout my
site by simply placing ContentPlaceHolders into hidden panels in the MasterPage. &amp;nbsp;In
that context, this practice might be a temporary fix pending a visit to each page
in the web site.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Since our business involves a lot
of mobility and we invite customers to visit our web site from their pocket pc, I’ve
been thinking that this technique of "hiding" content placeholders might offer a better
way to create a Pocket PC friendly user experience.&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Currently, I&amp;nbsp;substitute the
CSS file or even redirect the user to a special section of my web site whenever I
detect they are using Pocket IE. You can see this in action if you visit &lt;a href="http://www.pocketforms.net/"&gt;http://www.pocketforms.net&lt;/a&gt; (first
in your browser then from your pocket pc.) &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;With Dynamic MasterPages, I can
programmatically select a specific master page based on the&amp;nbsp;requestor's browser
type.&amp;nbsp; The pocket pc (or smartphone) master page, for example, can reference
a style sheet (.CSS file) which is appropriate for the device and also hide superfluous
ContentPlaceHolders such as banners and advertising.&amp;nbsp; This approach works much
better than a pure CSS approach since hidden content is omitted server-side and never
sent to the client.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;The following code was inspired
by &lt;a href="blogs.msdn.com/keiths"&gt;Keith Smith's&lt;/a&gt; presentation at the &lt;a href="http://www.onetug.org/"&gt;Orlando
.Net User Group&lt;/a&gt; and can be used to programmatically switch to the Pocket PC friendly
master page when a "Windows CE" (pocket pc) browser is detected.&amp;nbsp; In the following
code, the master page, pocketpc.master, changes the layout, hides some of the content
and references a CSS file with fonts and layout which are better suited for the smaller
form factor of a pocket pc.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;protected&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt;void&lt;/span&gt; Page
PreInit(&lt;span style="COLOR: blue"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: teal"&gt;EventArgs&lt;/span&gt; e)
{&lt;br&gt;
&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if&lt;/span&gt;(Request.Browser.Browser.ToLower.Contains(&lt;span style="COLOR: maroon"&gt;"windows
ce")){&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this&lt;/span&gt;&lt;span style="COLOR: maroon"&gt;.MasterPageFile
= "~/pocketpc.master";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; else&lt;/span&gt; {&lt;br&gt;
&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; this&lt;/span&gt;.MasterPageFile
= &lt;span style="COLOR: maroon"&gt;"~/MasterPage.master"&lt;/span&gt;;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br&gt;
}&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;In VB.Net, it looks like this:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: blue"&gt;Protected&lt;/span&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt; Page
PreInit(&lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; sender &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Object&lt;/span&gt;, &lt;span style="COLOR: blue"&gt;ByVal&lt;/span&gt; e &lt;span style="COLOR: blue"&gt;As&lt;/span&gt; System.EventArgs) &lt;span style="COLOR: blue"&gt;Handles&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Me&lt;/span&gt;.PreInit&lt;br&gt;
&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; If&lt;/span&gt; Request.Browser.Browser.ToLower.Contains(&lt;span style="COLOR: maroon"&gt;"windows
ce"&lt;/span&gt;) &lt;span style="COLOR: blue"&gt;Then&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/span&gt;.MasterPageFile = &lt;span style="COLOR: maroon"&gt;"~\pocketpc.master"&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Else&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; Me&lt;/span&gt;.MasterPageFile = &lt;span style="COLOR: maroon"&gt;"~\MasterPage.master"&lt;br&gt;
&lt;/span&gt;&lt;span style="COLOR: blue"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;If&lt;br&gt;
End&lt;/span&gt; &lt;span style="COLOR: blue"&gt;Sub&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Notice that the opportunity to swap
out the MasterPageFile occurs in the PreInit method which occurs early in the page
lifecycle (before any custom controls are loaded.) This means that the code cannot
be placed into a web custom control (which would be really convenient) but, instead
must be placed into the inline code or code-behind file of each page.&amp;nbsp;&lt;/span&gt;
&lt;br&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Rather than adding this code to
each page, this begs for a technique you always hear Carl Franklin, Richard Campbell
and their guests&amp;nbsp;talking about on &lt;a href="http://www.dotnetrocks.com/"&gt;.Net
Rocks&lt;/a&gt;. That is, to have all your web forms inherit from a custom class rather
than from the default, System.Web.UI.Page. When you add behaviors&amp;nbsp;such as&amp;nbsp;variable
MasterPages to your custom page class, then all of your (derived)&amp;nbsp;web forms will&amp;nbsp;inherit
that behavior as well. &amp;nbsp;Since each of my pages inherit from a class called “webFormBase”,
I simply added the code into the Page PreInit event within webFormBase and I get automatic
master page switching.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Watch for another blog on this subject
for a generic sample of this in action.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=89850ecb-7936-4d4c-a9dc-61178a3f3e45" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,89850ecb-7936-4d4c-a9dc-61178a3f3e45.aspx</comments>
      <category>Asp.Net</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Last year, I re-designed our corporate
web site to use the MasterPages feature in what was then the Beta version
of Visual Studio 2005. I did not bother to read the documentation (which
is a testament to their ease-of-use) and if I had, I might have discovered how
default template placeholders work.</span>
          </p>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Like a lot of folks, I created a
Master Page first and then created web forms that "used a selected master page".
When you create a new form in this way, content panels which correspond to each
of the Master Page's ContentPlaceholders are automatically inserted into the page.
The next step is obviously to add a bunch of page-specific content into each panel.
This was very intuitive and for me, my efforts were well rewarded when I later changed
the layout of my master page and everything fell into place.</span>
          </p>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">At last week's Orlando .Net User
Group (ONETUG) meeting here in Orlando, <a href="http://blogs.msdn.com/keiths">Microsoft's
Keith Smith</a> gave a really great presentation on Master Pages and Atlas. He demonstrated
how to add content into the ContentPlaceHolders of the Master Page, then, by simply
omitting the corresponding content panel on a detail page, the (default) content of
the Master Page's ContentPlaceHolder is rendered in its place.</span>
          </p>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Since I had gotten into the
habit of adding an empty ContentPlaceHolder to the Master Page then updating each
web form with the corresponding content, I might never have realized that the ContentPanel
on each form is optional. A few months ago, in fact, I systematically updated every
one of my web pages with a ContentPanel corresponding to a new ContentPlaceHolder.
Ironically, most of the new content panels received the same user control
which, of course, could have been the default content of my new ContentPanel.</span>
          </p>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Live and learn!</span>
          </p>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Going the other way, I had a situation
where I needed to get rid of obsolete Content Panels on my web pages. Each of
my pages included a content panel into which I had placed an image control with a
unique graphic for the page.  When I deleted the corresponding ContentPlaceHolder
from the master page, each of my pages complained that the ContentPanel had an invalid
ContentPlaceHolder attribute. While I would ultimately want to visit each page and
delete that ContentPanel (or recycle it with different content), I was able to instantly
omit the content by restoring the ContentPlaceHolder in my master page and placing
it into a hidden Panel Control.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5" />
      </body>
      <title>Default ContentPlaceHolder content in Asp.Net MasterPages</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx</guid>
      <link>http://mishler.net/2006/04/09/DefaultContentPlaceHolderContentInAspNetMasterPages.aspx</link>
      <pubDate>Sun, 09 Apr 2006 00:00:40 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Last year, I re-designed our corporate
web site to use the&amp;nbsp;MasterPages feature in what was&amp;nbsp;then the Beta version
of&amp;nbsp;Visual Studio 2005. I&amp;nbsp;did&amp;nbsp;not bother to read the documentation (which
is a testament to&amp;nbsp;their ease-of-use) and if I had, I might have discovered&amp;nbsp;how
default template placeholders work.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Like a lot of folks, I created a
Master Page first and then created web forms&amp;nbsp;that&amp;nbsp;"used a selected master&amp;nbsp;page".
When you create a new form in this way,&amp;nbsp;content panels which correspond to each
of the Master Page's ContentPlaceholders are automatically inserted into the page.
The next step is obviously to add a bunch of page-specific content into each panel.
This was very intuitive and for me, my efforts were well rewarded when I later changed
the layout of my master page and everything fell into place.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;At last week's Orlando .Net User
Group (ONETUG) meeting here in Orlando, &lt;a href="http://blogs.msdn.com/keiths"&gt;Microsoft's
Keith Smith&lt;/a&gt; gave a really great presentation on Master Pages and Atlas. He demonstrated
how to add content into the ContentPlaceHolders of the Master Page, then, by simply
omitting the corresponding content panel on a detail page, the (default) content of
the Master Page's ContentPlaceHolder is rendered in its place.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Since&amp;nbsp;I had gotten into the
habit of adding an empty ContentPlaceHolder to the Master Page then updating each
web form with the corresponding content, I might never have realized that the ContentPanel
on each form is optional. A few months ago, in fact, I systematically updated every
one of my web pages with a ContentPanel corresponding to a new ContentPlaceHolder.
Ironically,&amp;nbsp;most of the new content panels received&amp;nbsp;the same user control
which, of course, could have been the default content of my new ContentPanel.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Live and learn!&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Going the other way, I had a situation
where I needed to get rid of&amp;nbsp;obsolete Content Panels on my web pages. Each of
my pages included a content panel into which I had placed an image control with a
unique graphic for the page.&amp;nbsp; When I deleted&amp;nbsp;the corresponding ContentPlaceHolder
from the master page, each of my pages complained that the ContentPanel had an invalid
ContentPlaceHolder attribute. While I would ultimately want to visit each page and
delete that ContentPanel (or recycle it with different content), I was able to instantly
omit the content by&amp;nbsp;restoring the ContentPlaceHolder in my master page and&amp;nbsp;placing
it into a hidden Panel Control.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,dafdd9ae-5d5b-40e2-8c33-1ec0a119efb5.aspx</comments>
      <category>Asp.Net</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=827f1be1-d138-4d2d-92c1-e339bf16f950</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,827f1be1-d138-4d2d-92c1-e339bf16f950.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,827f1be1-d138-4d2d-92c1-e339bf16f950.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=827f1be1-d138-4d2d-92c1-e339bf16f950</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>How to import existing Asp.Net Membership data into CommunityServer</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,827f1be1-d138-4d2d-92c1-e339bf16f950.aspx</guid>
      <link>http://mishler.net/2006/04/07/HowToImportExistingAspNetMembershipDataIntoCommunityServer.aspx</link>
      <pubDate>Fri, 07 Apr 2006 02:10:19 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;h4&gt;How to import existing Asp.Net Membership data into CommunityServer 
&lt;/h4&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I am in the process of enhancing my existing web site
with the forums capabilities offered by CommunityServer. Since I already have several
thousand members registered on my site, I would like to either migrate their data
into Community Server or find a clean way to share authentication information so my
existing members do not have to maintain separate passwords for the existing customer-service
and new community server functions. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;When I saw that CommunityServer was using the Asp.Net
membership provider model for authentication, I became hopeful that I might be able
to share a common membership database with my own web application since I am using
Microsoft's SqlMembershipProvider.&amp;nbsp; Unfortunately, I found that CommunityServer
is using a non-standard membership database schema (by default) which is incompatible
with Microsoft's SQL providers, so I would not be able to simply point my provider
to their membership tables. I did look into Telligent's Asp.Net Forms Authentication
module but, as was explained to me, that module provides access for existing CommunityServer
users and, of course, my users were not in the CommunityServer membrship database.
In any case, I was curious to see if I could import my existing membership users into
Community Server.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Part 1 - Import existing membership users into the CommunityServer database&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Using SQL Server Import and Export Wizard in SQL Server
Management Studio (SQL Server 2005), I was easily able to append the User and Membership
data from my existing application into the corresponding tables in the CommunityServer
database. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Since AspNet Membership depends on AspNet Users and
they both depend on AspNet Applications, I found that the Foreign Key constraints
would not let me just check everything off and run the wizard. By running it first
for AspNet Applications and then for AspNet Users, I was able to then import AspNet
Membership as shown below: &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Step 1: Run the wizard for AspNet Applications. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=228 src="http://brian.mishler.net/content/binary/image0011.gif" width=459&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Step 2: Run the wizard again for AspNet Users. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=229 src="http://brian.mishler.net/content/binary/image0021.gif" width=458 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Step 3: Run the wizard one more time for AspNet Membership. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=209 src="http://brian.mishler.net/content/binary/image003.gif" width=472 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Although my data was now physically located in the same
database, a bit of massaging was still necessary to make it usable by CommunityServer.
CommunityServer has its own user-related tables and also my user information is stamped
with a distinct ApplicationId. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Part 2 - Consolidate the ApplicationID &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;My data was originally created using mostly generic
provider settings and may therefore be distinguished by a unique ApplicationId in
the AspNet Applications, AspNet Users, AspNet Membership and AspNet Roles tables.
The data which was pre-populated by the CommunityServer Setup Wizard is uniquely identified
by its own ApplicationID. Further, the custom providers defined in CommunityServer’s
web.config file are configured to use the ApplicationID associated with the applicationName
“dev”. As shown here, I actually had two applications in my database at this point. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=88 src="http://brian.mishler.net/content/binary/image004.gif" width=403 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;In order for CommunityServer's provider to "see" the
membership data I just imported, I would have to change the ApplicationId in each
AspNet Membership and AspNet Users record to the one corresponding to the "dev" applicationName.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;So, here is the procedure for modifying the imported
data to use the applicationID corresponding to the applicationName “dev” &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;1. Issue the following statements in SQL Server: &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
DECLARE @DevApplicationID uniqueidentifier
&lt;/p&gt;&lt;?XML:NAMESPACE PREFIX = O /&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p class=MsoNormal&gt;
DECLARE @SlashApplicationID uniqueidentifier
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p class=MsoNormal&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
SELECT @DevApplicationID=applicationID FROM AspNet Applications WHERE ApplicationName='dev'
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p class=MsoNormal&gt;
SELECT @SlashApplicationID=applicationID FROM AspNet Applications WHERE ApplicationName='/'
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p class=MsoNormal&gt;
&lt;O:P&gt;&amp;nbsp;&lt;/O:P&gt;
&amp;nbsp; &amp;nbsp; 
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
UPDATE AspNet Membership SET ApplicationID=@DevApplicationID WHERE ApplicationID=@SlashApplicationID
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;UPDATE AspNet Users SET ApplicationID=@DevApplicationID
WHERE ApplicationID=@SlashApplicationID&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;2. Delete the record in AspNet Applications for ApplicationName=”/”.
This record is now unused. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
DELETE FROM AspNet Applications WHERE ApplicationName='/'
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;At this point, all of my existing member records are
physically contained in CommunityServer's Asp.Net membership tables and have been
updated with the same ApplicationID that is referred-to by their custom membership
providers. Still, CommunityServer cannot use my imported data since its custom user
tables have not been loaded. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Part 3 - CommunityServer’s Roles&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I noticed that when a new “guest” user is added into
the system, he/she is added to the “Everyone” role. I was not sure if this is a requirement,
but it was simple enough to do this for each of my existing (legacy) users with the
following SQL Statement:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;DECLARE @DevApplicationID uniqueidentifier&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;O:P&gt;&lt;/O:P&gt;
SELECT @DevApplicationID=applicationID FROM AspNet Applications WHERE ApplicationName='dev'
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;DECLARE @EveryoneRoleID uniqueidentifier&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;SELECT @EveryoneRoleID=RoleID FROM AspNet Roles WHERE
loweredRoleName='everyone' AND ApplicationID=@DevApplicationID&lt;O:P&gt;&lt;/O:P&gt;
&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
INSERT INTO AspNet UsersInRoles (UserID,RoleID) SELECT UserID,@EveryoneRoleID FROM
AspNet Users WHERE UserID NOT IN (SELECT UserID from AspNet UsersInRoles)
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Note that @EveryoneRoleID is the value in the roleID
(GUID) column that corresponds to the “everyone” role in the AspNet roles table. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Part 4 - Importing data into CommunityServer’s User tables&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;I really like the fact that CommunityServer leverages
the AspNet membership providers for generic mainstream authentication functions. I
believe this is a trend we will see more of now that Microsoft has established a de-facto
standard. Telligent has done the smart thing by extending the base providers with
their own customized versions that provide application-specific functionality and
utilize additional data tables. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;While I was not able to find any documentation on the
Internet, I was able, through trial and error, to figure out which minimal data is
required in the CommunityServer tables. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The cs users table maps the AspNet membership system’s
UserID to the userID which is used internally by CommunityServer. Whereas Asp.Net
uses a GUID to uniquely identify users, CommunityServer’s userID is an Integer which
is autonumbered. Since most of the fields defaulted to good values, I was able to
populate the CommunityServer Users table with the following SQL Statement: &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
INSERT INTO cs users (membershipID) SELECT UserID from AspNet Membership where UserID
not in (SELECT MembershipID as UserID from cs users)
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Notice that CommunityServer knows the AspNet membership
system’s UserID as “MembershipID” in order that it can use the name “UserID” for its
own purposes. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The cs UserProfile table includes colums for tracking
the much of the same profile data that is maintained in the AspNet Profile table.
I am not sure why it is being kept in both places but I am guessing that the cs UserProfile
table is left over from previous implementations and still used as the primary storage
location for profile data. In any case, a record is required for each user and the
minimum (non-default) data appears to be the UserID, MembershipID and a settingsID. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The UserID and MembershipID were pretty handy for each
user and I discovered that the settingsID corresponded to the key field value in the
cs SiteSettings table. In my case, there was a single record whose value was 1000.
Thus, I was able to initialize the cs UserProfile table with the following SQL Statement: &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
INSERT INTO cs userprofile (membershipID,UserId,settingsID) SELECT MembershipID,userid,1000
FROM cs users WHERE userid NOT IN (SELECT userid FROM cs userprofile) 
&lt;/p&gt;
&lt;O:P&gt;&lt;/O:P&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Now able to log in &lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Having tweaked the ApplicationID, imported my existing
users, created “everyone” role records for each and inserted records into the cs users
and cs userprofile tables, I was now able to log into CommunityServer using an account
from my existing web site. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Moving forward, I recognize that the CommunityServer
membership system will immediately become unsynchronized with my own. While I am considering
using the Asp.Net Forms Authentication module (possibly with some extra work on my
part) I am opposed to duplication of any type of information, especially user credentials. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;In the meantime, I believe there are plenty of folks
that might wish to migrate existing membership data over to CommunityServer and thereafter
let CommunityServer handle user credential management. Hopefully, this article will
help. If anyone knows more or has insight on this subject, I invite your suggestions
and comments. &lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=827f1be1-d138-4d2d-92c1-e339bf16f950" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,827f1be1-d138-4d2d-92c1-e339bf16f950.aspx</comments>
      <category>CommunityServer</category>
    </item>
    <item>
      <trackback:ping>http://mishler.net/Trackback.aspx?guid=afe7b0da-3996-4607-9b07-e6eb913a1471</trackback:ping>
      <pingback:server>http://mishler.net/pingback.aspx</pingback:server>
      <pingback:target>http://mishler.net/PermaLink,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</pingback:target>
      <dc:creator>Brian Mishler</dc:creator>
      <wfw:comment>http://mishler.net/CommentView,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</wfw:comment>
      <wfw:commentRss>http://mishler.net/SyndicationService.asmx/GetEntryCommentsRss?guid=afe7b0da-3996-4607-9b07-e6eb913a1471</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="Section1">
          <p>
            <span style="FONT-SIZE: 10pt">One of the great things about the Asp.Net Membership
System is that it was designed to snap into many types of enterprise and off-the-shelf
applications to provide a consistent model for common tasks such as authenticating
users.  Several of the database tables (AspNet Users, AspNet Membership and AspNet
Roles) include an “ApplicationID” column, which allows for more than one application
to utilize a single database. Therefore, it is possible for two different users of
two separate applications to have the same username without experiencing a conflict
since the combined ApplicationID &amp; UserName would be distinct.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">A master table, AspNet Applications, includes a list
of the distinct ApplicationID’s which may be in use by the various membership tables. 
Since this field is a “uniqueidentifier” (GUID), a separate string field called “ApplicationName”
is available for looking up the ApplicationID.  The following figure illustrates
a record in the AspNet Applications table that maps an ApplicationName “/” to the
globally unique ApplicationID.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">
              <img height="69" src="http://brian.mishler.net/content/binary/image001.gif" width="402" border="0" />
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The ApplicationName can be nearly any string (up to
256 characters) and is originally defined, not in the database, but as an attribute
of each of the SQL Server providers (AspNetSqlMembershipProvider , AspNetSqlProfileProvider
, AspNetSqlRoleProvider.)  </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The default attributes for each of the AspNet SQL Providers
are defined in machine.config, which is generally stored in c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config. 
This is an important file that should never be modified so Asp.Net lets you override
any of its settings by simply placing sections of the file into a web.config file
within your web site.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The following is an excerpt from the &lt;system.web&gt;
section of machine.config, which defines the System.Web.Security.SqlMembership provider
as the default provider for handling membership. Notice that one of its attributes,
applicationName, is set to a backslash. </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: black">&lt;system.web&gt;<br />
…<br />
&lt;membership&gt;<br />
 &lt;providers&gt;<br />
&lt;clear /&gt;<br />
&lt;add connectionStringName="LocalSqlServer" 
<br />
enablePasswordRetrieval="false"<br />
enablePasswordReset="true" 
<br />
requiresQuestionAndAnswer="true"<br /></span>
            <strong>applicationName="/"</strong>
            <span style="FONT-SIZE: 10pt">
              <span style="COLOR: black">
                <br />
requiresUniqueEmail="false"<br />
passwordFormat="Hashed" 
<br />
maxInvalidPasswordAttempts="5" 
<br />
minRequiredPasswordLength="7" 
<br />
minRequiredNonalphanumericCharacters="1" 
<br />
passwordAttemptWindow="10" 
<br />
passwordStrengthRegularExpression="" 
<br />
name="AspNetSqlMembershipProvider" 
<br />
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&gt;<br />
&lt;/providers&gt;<br />
&lt;/membership&gt;<br />
…<br />
&lt;/system.web&gt;</span>
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">If you wanted to store data for more than one application
within a single database or if you desired some control over the applicationName which
is used in the AspNet Applications table, you can create a web.config file, in the
root folder of your web site, to override the applicationName that is specified in
machine.config (shown above.)</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The following is an excerpt from web.config. Notice
that &lt;clear /&gt; is used to remove any default providers (such as the one in machine.config)
from memory and that the applicationName has now been set to something more interesting.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: black">&lt;membership&gt;<br />
 &lt;providers&gt;<br />
 &lt;clear /&gt;<br />
 &lt;add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" <br />
enablePasswordReset="true" 
<br />
requiresQuestionAndAnswer="true"<br /></span>
            <strong>applicationName="myCustomApp" </strong>
            <b>
              <span style="FONT-SIZE: 10pt">
                <br />
              </span>
            </b>
            <span style="FONT-SIZE: 10pt; COLOR: black">requiresUniqueEmail="false" 
<br />
passwordFormat="Hashed" 
<br />
maxInvalidPasswordAttempts="5" 
<br />
minRequiredPasswordLength="7" 
<br />
minRequiredNonalphanumericCharacters="1" 
<br />
passwordAttemptWindow="10" 
<br />
passwordStrengthRegularExpression="" 
<br />
name="AspNetSqlMembershipProvider" 
<br />
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&gt;<br />
 &lt;/providers&gt;<br />
 &lt;/membership&gt;</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Assuming you have already been running the web application,
there is likely a pre-existing record in the AspNet Applications table as well as
records in the other membership (AspNet Membership, AspNet Users, AspNet Roles) tables
that correspond to the ApplicationID for “/”.  So guess what happens in the database
the first time the application is run after changing the ApplicationName in web.config?</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">
              <img height="88" src="http://brian.mishler.net/content/binary/image002.gif" width="403" border="0" />
            </span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">As shown here, a new record, along with a new ApplicationID,
has been generated by the provider. All of your existing data including membership,
users and roles is still stamped with the original ApplicationID and therefore inaccessible
by your provider. This is not a flaw in the system or an oversight on the part of
Microsoft. It is simply something you must understand if you intend to modify the
applicationName attribute on your provider configuration settings.</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Let’s say you have some existing membership records
and wish to associate them with the new ApplicationName/ApplicationID. This is very
simple to accomplish by issuing the following statements in SQL Server:</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Membership SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Users SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt; COLOR: gray">UPDATE AspNet Roles SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">(Please substitute the appropriate GUID for “new-application-id”
and “old-application-id”)</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">The SQLMembership provider’s foreign-key constraints
will prevent you from deleting the original AspNet Applications record for “/” until
you have successfully modified the ApplicationID values in each of the membership
tables.  Assuming that you performed the suggested updates then successfully
deleted the record in AspNet Applications for “/”, can you see how a new record, again
with a backslash “/” in the ApplicationName field, might be re-created the next time
you run the web application?</span>
          </p>
          <p>
            <span style="FONT-SIZE: 10pt">Other providers, such as the AspNetSqlRoleProvider and
the AspNetSqlProfileProvider also define default behaviors in machine.config and therein,
the attribute for applicationName is “/” by default.  If you use roles or profiles
in your web application, be sure to override the default implementation for all three
AspNet providers in web.config as appropriate for your solution.</span>
          </p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <p class="MsoNormal">
            <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
            </span> 
</p>
          <div>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Brian Mishler</span>
            </p>
            <p class="MsoAutoSig">
              <span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">
                <a href="http://www.qualitydata.com/">http://www.qualitydata.com</a>
              </span>
            </p>
          </div>
          <p class="MsoNormal">
 
</p>
          <p class="MsoNormal">
 
</p>
        </div>
        <img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=afe7b0da-3996-4607-9b07-e6eb913a1471" />
      </body>
      <title>Asp.Net Provider Model: ApplicationNames and the ApplicationID</title>
      <guid isPermaLink="false">http://mishler.net/PermaLink,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</guid>
      <link>http://mishler.net/2006/04/06/AspNetProviderModelApplicationNamesAndTheApplicationID.aspx</link>
      <pubDate>Thu, 06 Apr 2006 02:04:54 GMT</pubDate>
      <description>&lt;div class=Section1&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;One of the great things about the Asp.Net Membership
System is that it was designed to snap into many types of enterprise and off-the-shelf
applications to provide a consistent model for common tasks such as authenticating
users.&amp;nbsp; Several of the database tables (AspNet Users, AspNet Membership and AspNet
Roles) include an “ApplicationID” column, which allows for more than one application
to utilize a single database. Therefore, it is possible for two different users of
two separate applications to have the same username without experiencing a conflict
since the combined ApplicationID &amp;amp; UserName would be distinct.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;A master table, AspNet Applications, includes a list
of the distinct ApplicationID’s which may be in use by the various membership tables.&amp;nbsp;
Since this field is a “uniqueidentifier” (GUID), a separate string field called “ApplicationName”
is available for looking up the ApplicationID.&amp;nbsp; The following figure illustrates
a record in the AspNet Applications table that maps an ApplicationName “/” to the
globally unique ApplicationID.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=69 src="http://brian.mishler.net/content/binary/image001.gif" width=402 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The ApplicationName can be nearly any string (up to
256 characters) and is originally defined, not in the database, but as an attribute
of each of the SQL Server providers (AspNetSqlMembershipProvider , AspNetSqlProfileProvider
, AspNetSqlRoleProvider.)&amp;nbsp; &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The default attributes for each of the AspNet SQL Providers
are defined in machine.config, which is generally stored in c:\windows\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.&amp;nbsp;
This is an important file that should never be modified so Asp.Net lets you override
any of its settings by simply placing sections of the file into a web.config file
within your web site.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The following is an excerpt from the &amp;lt;system.web&amp;gt;
section of machine.config, which defines the System.Web.Security.SqlMembership provider
as the default provider for handling membership. Notice that one of its attributes,
applicationName, is set to a backslash. &lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;&amp;lt;system.web&amp;gt;&lt;br&gt;
…&lt;br&gt;
&amp;lt;membership&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;providers&amp;gt;&lt;br&gt;
&amp;lt;clear /&amp;gt;&lt;br&gt;
&amp;lt;add connectionStringName="LocalSqlServer" 
&lt;br&gt;
enablePasswordRetrieval="false"&lt;br&gt;
enablePasswordReset="true" 
&lt;br&gt;
requiresQuestionAndAnswer="true"&lt;br&gt;
&lt;/span&gt;&lt;strong&gt;applicationName="/"&lt;/strong&gt;&lt;span style="FONT-SIZE: 10pt"&gt; &lt;span style="COLOR: black"&gt;
&lt;br&gt;
requiresUniqueEmail="false"&lt;br&gt;
passwordFormat="Hashed" 
&lt;br&gt;
maxInvalidPasswordAttempts="5" 
&lt;br&gt;
minRequiredPasswordLength="7" 
&lt;br&gt;
minRequiredNonalphanumericCharacters="1" 
&lt;br&gt;
passwordAttemptWindow="10" 
&lt;br&gt;
passwordStrengthRegularExpression="" 
&lt;br&gt;
name="AspNetSqlMembershipProvider" 
&lt;br&gt;
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&amp;gt;&lt;br&gt;
&amp;lt;/providers&amp;gt;&lt;br&gt;
&amp;lt;/membership&amp;gt;&lt;br&gt;
…&lt;br&gt;
&amp;lt;/system.web&amp;gt;&lt;/span&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;If you wanted to store data for more than one application
within a single database or if you desired some control over the applicationName which
is used in the AspNet Applications table, you can create a web.config file, in the
root folder of your web site, to override the applicationName that is specified in
machine.config (shown above.)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The following is an excerpt from web.config. Notice
that &amp;lt;clear /&amp;gt; is used to remove any default providers (such as the one in machine.config)
from memory and that the applicationName has now been set to something more interesting.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;&amp;lt;membership&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;providers&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;clear /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;add connectionStringName="LocalSqlServer" enablePasswordRetrieval="false"&amp;nbsp;&lt;br&gt;
enablePasswordReset="true" 
&lt;br&gt;
requiresQuestionAndAnswer="true"&lt;br&gt;
&lt;/span&gt;&lt;strong&gt;applicationName="myCustomApp" &lt;/strong&gt;&lt;b&gt;&lt;span style="FONT-SIZE: 10pt"&gt;
&lt;br&gt;
&lt;/span&gt;&lt;/b&gt;&lt;span style="FONT-SIZE: 10pt; COLOR: black"&gt;requiresUniqueEmail="false" 
&lt;br&gt;
passwordFormat="Hashed" 
&lt;br&gt;
maxInvalidPasswordAttempts="5" 
&lt;br&gt;
minRequiredPasswordLength="7" 
&lt;br&gt;
minRequiredNonalphanumericCharacters="1" 
&lt;br&gt;
passwordAttemptWindow="10" 
&lt;br&gt;
passwordStrengthRegularExpression="" 
&lt;br&gt;
name="AspNetSqlMembershipProvider" 
&lt;br&gt;
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a" /&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/providers&amp;gt;&lt;br&gt;
&amp;nbsp;&amp;lt;/membership&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Assuming you have already been running the web application,
there is likely a pre-existing record in the AspNet Applications table as well as
records in the other membership (AspNet Membership, AspNet Users, AspNet Roles) tables
that correspond to the ApplicationID for “/”.&amp;nbsp; So guess what happens in the database
the first time the application is run after changing the ApplicationName in web.config?&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;&lt;img height=88 src="http://brian.mishler.net/content/binary/image002.gif" width=403 border=0&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;As shown here, a new record, along with a new ApplicationID,
has been generated by the provider. All of your existing data including membership,
users and roles is still stamped with the original ApplicationID and therefore inaccessible
by your provider. This is not a flaw in the system or an oversight on the part of
Microsoft. It is simply something you must understand if you intend to modify the
applicationName attribute on your provider configuration settings.&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Let’s say you have some existing membership records
and wish to associate them with the new ApplicationName/ApplicationID. This is very
simple to accomplish by issuing the following statements in SQL Server:&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Membership SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Users SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt; COLOR: gray"&gt;UPDATE AspNet Roles SET ApplicationID=’new-application-id’
WHERE ApplicationID=’old-application-id’&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;(Please substitute the appropriate GUID for “new-application-id”
and “old-application-id”)&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;The SQLMembership provider’s foreign-key constraints
will prevent you from deleting the original AspNet Applications record for “/” until
you have successfully modified the ApplicationID values in each of the membership
tables.&amp;nbsp; Assuming that you performed the suggested updates then successfully
deleted the record in AspNet Applications for “/”, can you see how a new record, again
with a backslash “/” in the ApplicationName field, might be re-created the next time
you run the web application?&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;span style="FONT-SIZE: 10pt"&gt;Other providers, such as the AspNetSqlRoleProvider and
the AspNetSqlProfileProvider also define default behaviors in machine.config and therein,
the attribute for applicationName is “/” by default.&amp;nbsp; If you use roles or profiles
in your web application, be sure to override the default implementation for all three
AspNet providers in web.config as appropriate for your solution.&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;/span&gt;&amp;nbsp;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;Brian Mishler&lt;/span&gt;
&lt;/p&gt;
&lt;p class=MsoAutoSig&gt;
&lt;span style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"&gt;&lt;a href="http://www.qualitydata.com/"&gt;http://www.qualitydata.com&lt;/a&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p class=MsoNormal&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;/div&gt;
&lt;img width="0" height="0" src="http://mishler.net/aggbug.ashx?id=afe7b0da-3996-4607-9b07-e6eb913a1471" /&gt;</description>
      <comments>http://mishler.net/CommentView,guid,afe7b0da-3996-4607-9b07-e6eb913a1471.aspx</comments>
      <category>Asp.Net Providers</category>
    </item>
  </channel>
</rss>