<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DZone Snippets: Mwgriffith's Code Snippets</title>
    <link>http://snippets.dzone.com/posts</link>
    <pubDate>Sun, 18 May 2008 06:56:00 GMT</pubDate>
    <description>DZone Snippets: Mwgriffith's Code Snippets</description>
    <item>
      <title>.net pipeline optimization for www sites.</title>
      <link>http://snippets.dzone.com/posts/show/5507</link>
      <description>Put the following code in the system.web part of the web.config file of the site you are working on.&lt;br /&gt;It will take out the session tracking and authorization http modules for your application. &lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;      &lt;httpModules&gt;&lt;br /&gt;        &lt;!-- Remove unnecessary Http Modules for faster pipeline --&gt;&lt;br /&gt;        &lt;remove name="Session" /&gt;&lt;br /&gt;        &lt;remove name="WindowsAuthentication" /&gt;&lt;br /&gt;        &lt;remove name="PassportAuthentication" /&gt;&lt;br /&gt;        &lt;remove name="AnonymousIdentification" /&gt;&lt;br /&gt;        &lt;remove name="UrlAuthorization" /&gt;&lt;br /&gt;        &lt;remove name="FileAuthorization" /&gt;&lt;br /&gt;      &lt;/httpModules&gt;&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;and yes I copied this from someone else, unfortunately I don't remember who.</description>
      <pubDate>Fri, 16 May 2008 18:19:58 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/5507</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
    <item>
      <title>Web Config and code for forms authentication in .net</title>
      <link>http://snippets.dzone.com/posts/show/4989</link>
      <description>Here's the forms authentication code that I always seem to forget.  &lt;br /&gt;&lt;br /&gt;Blatantly stolen from http://www.4guysfromrolla.com/webtech/110701-1.2.shtml and http://support.microsoft.com/kb/316871&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;Sub Submit_OnClick(sender as Object, e as EventArgs)&lt;br /&gt;  If MyCustomMethod (txtUserName.Text, txtPassword.Text) Then    &lt;br /&gt;      FormsAuthentication.RedirectFromLoginPage (txtUserName.Text, False)&lt;br /&gt;  Else&lt;br /&gt;      ' Invalid credentials supplied, display message&lt;br /&gt;      lblMessage.Text = "Invalid login credentials"&lt;br /&gt;  End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;configuration&gt;&lt;br /&gt;	&lt;system.web&gt;&lt;br /&gt;		&lt;authentication mode="Forms" &gt;&lt;br /&gt;			&lt;forms loginUrl="login.aspx" name=".ASPNETAUTH" protection="None" path="/" timeout="20" &gt;&lt;br /&gt;			&lt;/forms&gt;&lt;br /&gt;		&lt;/authentication&gt;&lt;br /&gt;&lt;!-- This section denies access to all files in this application except for those that you have not explicitly specified by using another setting. --&gt;&lt;br /&gt;		&lt;authorization&gt;&lt;br /&gt;			&lt;deny users="?" /&gt; &lt;br /&gt;		&lt;/authorization&gt;&lt;br /&gt;	&lt;/system.web&gt;&lt;br /&gt;&lt;!-- This section gives the unauthenticated user access to the Default1.aspx page only. It is located in the same folder as this configuration file. --&gt;&lt;br /&gt;		&lt;location path="default1.aspx"&gt;&lt;br /&gt;		&lt;system.web&gt;&lt;br /&gt;		&lt;authorization&gt;&lt;br /&gt;			&lt;allow users ="*" /&gt;&lt;br /&gt;		&lt;/authorization&gt;&lt;br /&gt;		&lt;/system.web&gt;&lt;br /&gt;		&lt;/location&gt;&lt;br /&gt;&lt;!-- This section gives the unauthenticated user access to all of the files that are stored in the Subdir1 folder.  --&gt;&lt;br /&gt;		&lt;location path="subdir1"&gt;&lt;br /&gt;		&lt;system.web&gt;&lt;br /&gt;		&lt;authorization&gt;&lt;br /&gt;			&lt;allow users ="*" /&gt;&lt;br /&gt;		&lt;/authorization&gt;&lt;br /&gt;		&lt;/system.web&gt;&lt;br /&gt;		&lt;/location&gt;&lt;br /&gt;&lt;/configuration&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Wed, 16 Jan 2008 18:27:34 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4989</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
    <item>
      <title>Gathering html id's from asp.net</title>
      <link>http://snippets.dzone.com/posts/show/4974</link>
      <description>The basic idea here is to pull the id's from asp.net so that it can be used in a javascript environment.&lt;br /&gt;&lt;br /&gt;&lt;code&gt;&lt;br /&gt;&lt;input id="GetLocation" type="button" onclick="getLocation(&lt;%=tbStreet.clientID %&gt;.value + ' ' + &lt;%=tbCity.clientID %&gt;.value + ' ' + &lt;%=tbState.clientID %&gt;.value + ' ' + &lt;%=tbZip.clientID %&gt;.value,'&lt;%=lblLocation.clientID %&gt;');" value="Get Location" /&gt;&lt;br /&gt;&lt;/code&gt;</description>
      <pubDate>Fri, 11 Jan 2008 16:28:38 GMT</pubDate>
      <guid>http://snippets.dzone.com/posts/show/4974</guid>
      <author>mwgriffith (Michael Griffith)</author>
    </item>
  </channel>
</rss>
