<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>George's Blog</title>
        <link>http://geekswithblogs.net/gevjen/Default.aspx</link>
        <description>Learning to Geek...</description>
        <language>en-US</language>
        <copyright>George Evjen</copyright>
        <managingEditor>george.evjen@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <image>
            <title>George's Blog</title>
            <url>http://geekswithblogs.net/images/RSS2Image.gif</url>
            <link>http://geekswithblogs.net/gevjen/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <item>
            <title>ViewState</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/19/122247.aspx</link>
            <description>&lt;p&gt;My topic for the week is ViewState. What is ViewState. Here is a pretty good example I found online at ASP 101 by John Peterson&lt;/p&gt;
&lt;p&gt;"It's probably easiest to explain with an example. Let's say you're about to buy something online. You've filled out your name, address, payment info, and given these people, whom you've never met, information you normally wouldn't share with your closest friends (but that's another rant altogether). You submit the form and the server comes back saying there's an error and you need to go back and add -'s to your phone number or some other petty little thing. You click the back button in your browser and you stare at the screen in dread as you realize all the entries you typed are now gone and you have to start all over! The site in question didn't maintain your viewstate. "&lt;/p&gt;
&lt;p&gt;ViewState was introduced to help eliminate the difficulties of programming in a stateless environment, meaning that the state of controls is not saved between postbacks. It was added in ASP.NET as a convienent way to store the state of objects between these postbacks of a page. ViewState comes at a cost to use though...Performance. You can turn off viewstate by using the attribute EnableViewState="false". By using viewstate you are adding to the size of each page that is created. ViewState works by adding HiddenFields to the response(__ViewState), which helps maintain the sesson of the objects on a page. If you were to look at the source of your page you will see something like this.&lt;/p&gt;
&lt;p&gt;&lt;font face="Arial"&gt;&amp;lt;input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMTkwMjg4NjgzM2QYAQUeX19Db250cm9sc1JlcXVpcmVQb3N0QmFja0tleV9fFgEFLmN0bDAwJE1haW4kY3RsMDgkY3RsMDIkY3RsMDIkY3RsMDIkY2hrUmVtZW1iZ/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;The information in the value is all the information for the page.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122247"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122247" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122247.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/19/122247.aspx</guid>
            <pubDate>Mon, 19 May 2008 20:48:51 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122247.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/19/122247.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122247.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122247.aspx</trackback:ping>
        </item>
        <item>
            <title>Day 5 - web.config information</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/16/122193.aspx</link>
            <description>&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Authentication in the web.config. Authentication is the process that determines the identity of a user. When you log onto your machine at the start of the day and you are asked for your username and password you are authenticating yourself. Who are you? On the web, once you are authenticated you then have authorization. What are you as a user allowed to see on a particular site. You could log in and your role as a user could be Administrator. Having the role of admin allows you to see files, links, folder and pages that another user won’t be able to see. &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;In one of my previous post I quickly talked about Authentication and Authorization. Today as my last day of studying some details about the web.config, I am going to revisit these two web.config elements and expand my thoughts on them.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;There are three modes options you can have in your web.config within the &amp;lt;authentication&amp;gt; element. Windows, Forms, Passport. To quickly cover these, Windows is more used for the intranet, Forms is more used for standard web pages and passport is Microsoft’s authenticating system. Forms is what we are going to cover today.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 10pt"&gt;&lt;font face="Calibri" size="3"&gt;Set your web.config up to use forms. This turns on everything you need to start using the membership services.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;system.web&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;authentication mode=”Forms”&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;/system.web&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;When a user enters a site for the first time he is an anonymous user. Anonymous is the default authentication mode. You can configure your web.config file to redirect the anonymous user to a specific page within the site to become authenticated. After the users is redirected to this login page and once he passes the authentication process he will be issued a cookie.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;system.web&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;authentication mode=”Forms”&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 1"&gt;                &lt;/span&gt;&amp;lt;forms name=”ASPXAUTH”&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;loginUrl=”login.aspx”&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 1.5in; TEXT-INDENT: 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;        timeout=”30” /&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;/system.web&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;The code above we added a loginUrl attribute which will take all anonymous users to the login.aspx page. Once authenticated the user will be directed to the default.aspx page. The name attribute is the name used for the cookie sent to the end uers. The timeout attribute is the time until the cookie will expire. The time above is set to 30 minutes. &lt;span style="mso-spacerun: yes"&gt; &lt;/span&gt;These are the basics for the authentication element.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;Some other thoughts on the web.config file. &lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;Where is the machine.config file located? Why would I need to know this?&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;You can find the machine config file C:\WINDOWS\Microsoft.NET\Framework\v2.0.xxxxx\CONFIG&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;It is important to know where this file is because it houses the default settings for all you applications, not just web applications. I wouldn’t change anything within this file unless you know what you are doing. If you take information from here and paste it within you web.config you will override the machine.config for that particular application. As an example. I don’t like having a password be a minimum of seven characters with at least one nonalphnumeric character included. I include the code below into my web.config file and now I have overridden what the machine.config has set up.&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 0.5in; LINE-HEIGHT: normal"&gt;&lt;o:p&gt;&lt;font face="Calibri" size="3"&gt; &lt;/font&gt;&lt;/o:p&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;&amp;lt;membership&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 3"&gt;                                                &lt;/span&gt;&amp;lt;providers&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt 2in; LINE-HEIGHT: normal"&gt;&lt;font face="Calibri" size="3"&gt;&amp;lt;add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" &lt;strong style="mso-bidi-font-weight: normal"&gt;minRequiredPasswordLength="4"&lt;/strong&gt; &lt;strong style="mso-bidi-font-weight: normal"&gt;minRequiredNonalphanumericCharacters="0"&lt;/strong&gt; passwordAttemptWindow="10" passwordStrengthRegularExpression=""/&amp;gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 3"&gt;                                                &lt;/span&gt;&amp;lt;/providers&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN: 0in 0in 0pt; LINE-HEIGHT: normal"&gt;&lt;font size="3"&gt;&lt;font face="Calibri"&gt;&lt;span style="mso-tab-count: 2"&gt;                                &lt;/span&gt;&amp;lt;/membership&amp;gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122193"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122193" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122193.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/16/122193.aspx</guid>
            <pubDate>Fri, 16 May 2008 14:29:43 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122193.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/16/122193.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122193.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122193.aspx</trackback:ping>
        </item>
        <item>
            <title>Day 4 - WebConfig Information</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/15/122182.aspx</link>
            <description>&lt;p&gt;My week long look into the web.config file is almost done. On top of all the other studying that I am doing in all things .NET I am focusing on one item per week and reading extra, coding extra and blogging about that particular item. So this week was configurations. I have read quite a bit on an elementary level and thought about some more complex issues. I am biased I guess but my brother's (Bill Evjen) chapter on configurations in his Professional ASP.NET 2.0 book covers quite a bit and is quite easy to follow. I am not sure what to investigate next week, so I am taking recommendations. Onward though with day 4 on configurations.&lt;/p&gt;
&lt;p&gt;An important portion of your web.config file will consist of the Page Configuration. The page configuration is important  because it will enable you to control some of the default behaviors for each and every .aspx page that is part of your web application. Below is a sample page element.&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;pages buffer="[True|False]"&lt;br /&gt;
   enableEventValidation="[True|False]"&lt;br /&gt;
   &lt;strong&gt;enableSessionState="[True|False|ReadOnly]"&lt;br /&gt;
&lt;/strong&gt;  &lt;strong&gt; enableViewState="[True|False]"&lt;br /&gt;
&lt;/strong&gt;   enableViewStateMac="[True|False]"&lt;br /&gt;
   smartNavigation="[True|False]"&lt;br /&gt;
   autoEventWireup="[True|False]"&lt;br /&gt;
   pageBaseType="typename, assembly"&lt;br /&gt;
   userControlBaseType="typename"&lt;br /&gt;
   validateRequest="[True|False]"&lt;br /&gt;
  &lt;strong&gt; masterPageFile="file path" &lt;br /&gt;
&lt;/strong&gt;   &lt;strong&gt;theme="string"&lt;/strong&gt;&lt;br /&gt;
  &lt;strong&gt; styleSheetTheme="string"&lt;br /&gt;
&lt;/strong&gt;   maxPageStateFieldLength="number" &lt;br /&gt;
   compilationMode="[Always|Auto|Never]" &lt;br /&gt;
   pageParserFilterType="string" &lt;br /&gt;
   viewStateEncryptionMode="[Always|Auto|Never]" &lt;br /&gt;
   maintainScrollPositionOnPostBack="[True|False]" &lt;br /&gt;
   asyncTimeout="number"&amp;gt;&amp;lt;/pages&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;By having the page element in your web.config file you are setting up you pages globally in one place instead of using the page directive on each page. You can set up each page in one place and make your changes globally. The attributes that you may find yourself using the most are in bold above.&lt;/p&gt;
&lt;p dir="ltr"&gt;&lt;strong&gt;enableSessionState&lt;/strong&gt; - Specifics whether the session state for the page should be enabled. Your options are true, false, or ReadOnly. &lt;/p&gt;
&lt;p dir="ltr"&gt;&lt;strong&gt;enableViewState&lt;/strong&gt; - Allows you to turn on/off your viewstate for all your controls on your aspx pages.&lt;/p&gt;
&lt;p dir="ltr"&gt;&lt;strong&gt;masterPageFile&lt;/strong&gt; - Specifies which master page you are using for your pages. Be careful how you use this attribute if your application uses more than one masterpage. Some sites us multiple masterpages.&lt;/p&gt;
&lt;p dir="ltr"&gt;&lt;strong&gt;theme&lt;/strong&gt; - Sets the theme for the pages and you are NOT allowed to overwrite the theme on the individual pages&lt;/p&gt;
&lt;p dir="ltr"&gt;&lt;strong&gt;styleSheetTheme&lt;/strong&gt; - Sets the theme for the pages and it DOES allow you to overwrite the themes on the individual pages.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122182"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122182" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122182.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/15/122182.aspx</guid>
            <pubDate>Thu, 15 May 2008 22:03:08 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122182.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/15/122182.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122182.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122182.aspx</trackback:ping>
        </item>
        <item>
            <title>Day 3 - Web.Config Information</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/14/122129.aspx</link>
            <description>&lt;p&gt;How to access the ASP.NET configuration settings.&lt;/p&gt;
&lt;p&gt;If you had the following information in your web.config file. How would you access this information. The idea is to have this information in one place within your application and you can now spread this information to multiple areas on your application. If you then have to change the information you only have to change it in one place as opposed to changing it in multiple places. &lt;/p&gt;
&lt;p&gt;  &amp;lt;appSettings&amp;gt;&lt;br /&gt;
      &amp;lt;add key="myConnectionString" value="&lt;em&gt;theConnectionStringWouldGoHere"&lt;/em&gt; /&amp;gt;&lt;br /&gt;
  &amp;lt;/appSettings&amp;gt;&lt;/p&gt;
&lt;p&gt;label1.Text = ConfigurationManager.AppSettings("myConnectionString");&lt;/p&gt;
&lt;p&gt;If you ran this the label would have the value of the appSettings configuration. You can now use this feature in your code behind to bind to your connection string in your web.config file.&lt;/p&gt;
&lt;p&gt;Another way to set the connection string.&lt;/p&gt;
&lt;p&gt;  &amp;lt;connectionStrings&amp;gt;&lt;br /&gt;
      &amp;lt;add name="myConnectionString" connectionString="thisIsWhereTheConnectionStringGoes" /&amp;gt;&lt;br /&gt;
  &amp;lt;/connectionStrings&amp;gt;&lt;/p&gt;
&lt;p&gt;To call this connection string from the code you use syntax that is similar to the appSettings syntax&lt;/p&gt;
&lt;p&gt;label.Text = ConfigurationManager.ConnectionStrings("myConnectionString").ConnectionString;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122129"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122129" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122129.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/14/122129.aspx</guid>
            <pubDate>Wed, 14 May 2008 14:58:55 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122129.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/14/122129.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122129.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122129.aspx</trackback:ping>
        </item>
        <item>
            <title>More web.config information</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/13/122105.aspx</link>
            <description>&lt;p&gt;Most used web.config settings&lt;/p&gt;
&lt;p&gt;1. &amp;lt;authentication&amp;gt; - &lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;
    &amp;lt;authentication mode="Windows" /&amp;gt;&lt;br /&gt;
&amp;lt;/system.web&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;
    &amp;lt;authentication mode="Forms" /&amp;gt;&lt;br /&gt;
&amp;lt;/system.web&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;system.web&amp;gt;&lt;br /&gt;
    &amp;lt;authentication mode="Passport" /&amp;gt;&lt;br /&gt;
&amp;lt;/system.web&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;The code above shows the type of authentication you are going to use for your site. Windows will be windows authentication, which is used normally within an intranet. Forms is used for setting up a traditional website and passport is set up by Microsoft&lt;/p&gt;
&lt;p&gt;2. &amp;lt;authorization&amp;gt; - Authorization refers to the permissions granted to a user. The webconfig refers to them as roles. The web.config takes a number of deny and allow tags within the authorization. You could for instance have a role of admin. You could then have specific files only allowed for those that are in the admin role. &lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;!-- SET UP AUTHORIZATION USING LOCATION TAG --&amp;gt;&lt;br /&gt;
&amp;lt;location path="AdminSites"&amp;gt;&lt;br /&gt;
   &amp;lt;system.web&amp;gt;&lt;br /&gt;
     &amp;lt;authorization&amp;gt;&lt;br /&gt;
       &amp;lt;allow roles="admin" /&amp;gt;&lt;br /&gt;
       &amp;lt;deny users="*" /&amp;gt;&lt;br /&gt;
     &amp;lt;/authorization&amp;gt;&lt;br /&gt;
   &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/location&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p dir="ltr"&gt;The code above uses a location tag. The location tag will clearify the directory we are setting up. The directory "AdminSites" is only available to those that are in the admin role and denied to all other members. &lt;/p&gt;
&lt;p&gt;3. &amp;lt;customErrors&amp;gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;pre&gt;&lt;span class="cs"&gt;&lt;/span&gt;&lt;pre&gt;&lt;span class="cs"&gt;&lt;/span&gt;&amp;lt;customErrors defaultRedirect="ErrorPage.aspx" mode="On"&amp;gt;   
    &lt;span class="cs"&gt;&lt;/span&gt;&amp;lt;error statusCode="500" redirect="servererror.aspx" /&amp;gt;
    &lt;span class="cs"&gt;&lt;/span&gt;&amp;lt;error statusCode="404" redirect="filenotfound.aspx" /&amp;gt;
    &lt;span class="cs"&gt;&lt;/span&gt;&amp;lt;error statusCode="403" redirect="AccessDenied.aspx" /&amp;gt; 
&lt;span class="cs"&gt;&lt;/span&gt;&amp;lt;/customErrors&amp;gt;&lt;/pre&gt;
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;When you encounter and error on a page you typically will receive a page that lists the error and a trace of the methods that were run right up until the error. If you use the customError configuration you will be able to direct the client to a page that will give a better presentation other than an error screen. You use the defaultRedirect attribut to be the default error page. Within the customError element you can add other errror pages for specific errors the client may encounter.&lt;/p&gt;
&lt;p&gt;4. &amp;lt;pages&amp;gt; - The page element list page specific properties. Using the pages element will eliminate the use of changing elements within the page directive of your application. Below is an extensive list of the attributes used within the page element&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;pages     &lt;br /&gt;
   buffer="[True|False]"&lt;br /&gt;
   enableEventValidation="[True|False]"&lt;br /&gt;
   enableSessionState="[True|False|ReadOnly]"&lt;br /&gt;
   enableViewState="[True|False]"&lt;br /&gt;
   enableViewStateMac="[True|False]"&lt;br /&gt;
   smartNavigation="[True|False]"&lt;br /&gt;
   autoEventWireup="[True|False]"&lt;br /&gt;
   pageBaseType="typename, assembly"&lt;br /&gt;
   userControlBaseType="typename"&lt;br /&gt;
   validateRequest="[True|False]"&lt;br /&gt;
   masterPageFile="file path" &lt;br /&gt;
   theme="string"&lt;br /&gt;
   styleSheetTheme="string"&lt;br /&gt;
   maxPageStateFieldLength="number" &lt;br /&gt;
   compilationMode="[Always|Auto|Never]" &lt;br /&gt;
   pageParserFilterType="string" &lt;br /&gt;
   viewStateEncryptionMode="[Always|Auto|Never]" &lt;br /&gt;
   maintainScrollPositionOnPostBack="[True|False]" &lt;br /&gt;
   asyncTimeout="number"&lt;br /&gt;
&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;5. &amp;lt;sessionState&amp;gt; - The attributes that are connected with the sessionState element are - mode, cookieless, timeout, stateConnectionString, sqlConnectionString and stateNetworkTimeout.&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;
   &amp;lt;system.web&amp;gt;&lt;br /&gt;
      &amp;lt;sessionState mode="InProc"&lt;br /&gt;
                    cookieless="true"&lt;br /&gt;
                    timeout="20"/&amp;gt;&lt;br /&gt;
      &amp;lt;/sessionState&amp;gt;&lt;br /&gt;
   &amp;lt;/system.web&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;6. &amp;lt;appSettings&amp;gt;&lt;/p&gt;
&lt;blockquote dir="ltr" style="MARGIN-RIGHT: 0px"&gt;
&lt;p&gt;&amp;lt;configuration&amp;gt;&lt;br /&gt;
    &amp;lt;appSettings&amp;gt;&lt;br /&gt;
        &amp;lt;add key="Application Name" value="MyApplication" /&amp;gt;&lt;br /&gt;
    &amp;lt;/appSettings&amp;gt;&lt;br /&gt;
&amp;lt;/configuration&amp;gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt; The appSettings element allows you to put data into the web.config so you do not have to have the code in multiple places within the application. Your application will simply call the appSettings element and get the data that it needs. The appSettings element is a key/value pair, it supports a sub-element called add.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122105"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122105" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122105.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/13/122105.aspx</guid>
            <pubDate>Tue, 13 May 2008 13:18:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122105.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/13/122105.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122105.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122105.aspx</trackback:ping>
        </item>
        <item>
            <title>WebConfig Information</title>
            <link>http://geekswithblogs.net/gevjen/archive/2008/05/12/122089.aspx</link>
            <description>&lt;p&gt;Web.Config Information&lt;/p&gt;
&lt;p&gt;- Contains information that controls module loading, security configuration, session state configuration, application language and compilation settings.&lt;/p&gt;
&lt;p&gt;- Also contains application specific items such as database connection strings.&lt;/p&gt;
&lt;p&gt;- Must be placed in the root directory&lt;/p&gt;
&lt;p&gt;- The Web config can be placed in sub-directories but those configurations will only be made available to the files within that sub-directory. &lt;/p&gt;
&lt;p&gt;- Each web application in ASP.NET inherits thier base web.config from the machine.config&lt;/p&gt;
&lt;p&gt;- The web.config can detect changes made, ASP.NET will restart the application when changes are made to the web.config file.&lt;/p&gt;
&lt;p&gt;- The root element of the web.config file should always be &amp;lt;configuration&amp;gt;&lt;/p&gt;
&lt;p&gt;-What typically goes in the &amp;lt;system.web&amp;gt; group&lt;/p&gt;
&lt;p&gt;&amp;lt;authorization&amp;gt;, &amp;lt;authentication&amp;gt;, &amp;lt;compliation&amp;gt;, &amp;lt;customerErrors&amp;gt;, &amp;lt;SessionState&amp;gt;, &amp;lt;globalization&amp;gt;, &amp;lt;httpRuntime&amp;gt;, &amp;lt;trace&amp;gt;&lt;/p&gt;
&lt;p&gt;- The web.config file is protected by IIS so clients cannot access or break into the file capturing important configuration information.&lt;/p&gt;
&lt;p&gt;- Configurations made on the machine.config encompass all applcations whereas web.config files only affect that particular applcation. &lt;/p&gt;
&lt;p&gt;- You can actually have an application without a web.config file - you would by default use the settings laid out by the machine.config. If you add a web.config file you can override the settings of the machine.config. &lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122089"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=122089" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/gevjen/aggbug/122089.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>George Evjen</dc:creator>
            <guid>http://geekswithblogs.net/gevjen/archive/2008/05/12/122089.aspx</guid>
            <pubDate>Mon, 12 May 2008 21:05:29 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/gevjen/comments/122089.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/gevjen/archive/2008/05/12/122089.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/gevjen/comments/commentRss/122089.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/gevjen/services/trackbacks/122089.aspx</trackback:ping>
        </item>
    </channel>
</rss>