<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>dot NET Mamma</title>
	<atom:link href="http://dotnetmamma.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnetmamma.wordpress.com</link>
	<description></description>
	<lastBuildDate>Sun, 12 Jun 2011 22:28:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='dotnetmamma.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>dot NET Mamma</title>
		<link>http://dotnetmamma.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://dotnetmamma.wordpress.com/osd.xml" title="dot NET Mamma" />
	<atom:link rel='hub' href='http://dotnetmamma.wordpress.com/?pushpress=hub'/>
		<item>
		<title>URL mapping/rewriting</title>
		<link>http://dotnetmamma.wordpress.com/2008/05/11/url-mappingrewriting/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/05/11/url-mappingrewriting/#comments</comments>
		<pubDate>Sat, 10 May 2008 18:43:50 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[urlrewrite]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=12</guid>
		<description><![CDATA[Here is something to check out. http://www.urlrewriting.net/en/Default.aspx I may try to incorporate this into my CMS.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=12&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is something to check out.</p>
<p><a href="http://www.urlrewriting.net/en/Default.aspx">http://www.urlrewriting.net/en/Default.aspx</a></p>
<p>I may try to incorporate this into my CMS.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=12&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/05/11/url-mappingrewriting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Using multiple sitemaps in an application</title>
		<link>http://dotnetmamma.wordpress.com/2008/04/05/using-multiple-sitemaps-in-an-application/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/04/05/using-multiple-sitemaps-in-an-application/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 18:04:54 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[.aspx]]></category>
		<category><![CDATA[.sitemap]]></category>
		<category><![CDATA[navigation controls]]></category>
		<category><![CDATA[sitemap provider]]></category>
		<category><![CDATA[web.config]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=10</guid>
		<description><![CDATA[I wanted to have more than one .sitemap file in my aplication.  The first one is for the navigation of the the user portion of the cms.  The second one would be in a subfolder and be used for the admin part of the site.   The first one for the user part of the site [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=10&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to have more than one .sitemap file in my aplication.  The first one is for the navigation of the the user portion of the cms.  The second one would be in a subfolder and be used for the admin part of the site. </p>
<p> The first one for the user part of the site is the default one called web.sitemap.  Then I created a second one called admin.sitemap in the secure folder of my website where all the other admin pages reside. </p>
<p>Then in the &lt;system.web&gt; section of the web.config file I registered the sitemaps in the following way:</p>
<p><font size="2" color="#0000ff">&lt;</font><font size="2" color="#a31515">siteMap</font><font size="2" color="#0000ff"> </font><font size="2" color="#ff0000">defaultProvider</font><font size="2" color="#0000ff">=</font><font size="2">&#8220;</font><font size="2" color="#0000ff">AspNetXmlSiteMapProvider</font><font size="2">&#8220;</font><font size="2" color="#0000ff">&gt;</font><font size="2" color="#0000ff">&lt;<font size="2" color="#a31515">providers</font><font size="2" color="#0000ff">&gt;&lt;</font></font><font size="2" color="#0000ff"> </font><font size="2" color="#a31515">add</font><font size="2" color="#0000ff"> </font><font size="2" color="#ff0000">name</font><font size="2" color="#0000ff">=</font><font size="2">&#8220;</font><font size="2" color="#0000ff">AdminXmlSiteMapProvider</font><font size="2">&#8220;</font><font size="2" color="#0000ff"> </font><font size="2" color="#ff0000">type</font><font size="2" color="#0000ff">=</font><font size="2">&#8220;</font><font size="2" color="#0000ff">System.Web.XmlSiteMapProvider</font><font size="2">&#8220;</font><font size="2" color="#0000ff"> </font><font size="2" color="#ff0000">siteMapFile</font><font size="2" color="#0000ff">=</font><font size="2">&#8220;~</font><font size="2" color="#0000ff">/Secure/admin.sitemap</font><font size="2">&#8220;</font><font size="2" color="#0000ff"> /&gt;</font><font size="2" color="#0000ff">&lt;/<font size="2" color="#a31515">providers</font><font size="2" color="#0000ff">&gt;&lt;/<font size="2" color="#a31515">siteMap</font><font size="2" color="#0000ff">&gt;</font></font></font><font size="2" color="#0000ff"><font size="2" color="#0000ff"></font>First it gives the default provider which has to be named &#8220;AspNetXmlSiteMapProvider&#8221;.  Then I added the second provider, giving it whatever name I choose.  Then siteMapFile shows the path to the file. </p>
<p></font>Next I used a SiteMapDataSource control to get the data to my Treeview control.  The SiteMapDataSource control is configured in the following way:</p>
<p><font size="2" color="#0000ff">&lt;<font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">SiteMapDataSource</font><font size="2"> </font><font size="2" color="#ff0000">ID</font><font size="2" color="#0000ff">=&#8221;SiteMapDataSource1&#8243;</font><font size="2"> </font><font size="2" color="#ff0000">runat</font><font size="2" color="#0000ff">=&#8221;server&#8221;</font><font size="2"> </font><font size="2" color="#ff0000">SiteMapProvider</font><font size="2" color="#0000ff">=&#8221;AdminXmlSiteMapProvider&#8221;/&gt;</font></font><font size="2" color="#0000ff">Thanks to DMan100 from this thread : <a href="http://forums.asp.net/t/1010684.aspx">http://forums.asp.net/t/1010684.aspx</a></p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=10&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/04/05/using-multiple-sitemaps-in-an-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Pre-Init handling</title>
		<link>http://dotnetmamma.wordpress.com/2008/04/04/pre-init-handling/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/04/04/pre-init-handling/#comments</comments>
		<pubDate>Fri, 04 Apr 2008 15:50:59 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[.aspx]]></category>
		<category><![CDATA[Code Behind]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[BasePage]]></category>
		<category><![CDATA[inheritance]]></category>
		<category><![CDATA[masterpage]]></category>
		<category><![CDATA[pre_init]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=11</guid>
		<description><![CDATA[Here are some links from OdetoCode.com that talk about the  pre_Init event.  http://odetocode.com/Blogs/scott/archive/2005/12/09/2604.aspx http://www.odetocode.com/articles/450.aspx I was looking for a way for the administrators of my cms to choose a template for their website.  I created a class and put it in the App_Code Folder and used the the example code for using the HttpModule.  It [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=11&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some links from OdetoCode.com that talk about the  pre_Init event. </p>
<p><a href="http://odetocode.com/Blogs/scott/archive/2005/12/09/2604.aspx">http://odetocode.com/Blogs/scott/archive/2005/12/09/2604.aspx</a></p>
<p><a href="http://www.odetocode.com/articles/450.aspx">http://www.odetocode.com/articles/450.aspx</a></p>
<p>I was looking for a way for the administrators of my cms to choose a template for their website.  I created a class and put it in the App_Code Folder and used the the example code for using the HttpModule.  It worked beautifully.  Here is the code I used to choose the template.  It the template names  are stored in an SQL Server database. Eventually the administrator will be able to add new templates to the cms.   </p>
<p><font size="2" color="#0000ff">Dim<font size="2"> value </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font></font><font size="2" color="#0000ff"><font size="2"></font><font size="2" color="#0000ff">Dim</font><font size="2"> connStr </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font><font size="2"> = ConfigurationManager.ConnectionStrings(</font><font size="2" color="#a31515">&#8220;TobetConnectionString&#8221;</font><font size="2">).ConnectionString</font><font size="2"><font size="2" color="#0000ff">Dim</font><font size="2"> myConn </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">New</font><font size="2"> SqlConnection(connStr)<font size="2" color="#0000ff">Dim</font><font size="2"> strQuery </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font><font size="2"> = </font><font size="2" color="#a31515">&#8220;select top 1 [ID], [Template] From [SiteConfig]&#8220;</font></font></font></font><font size="2" color="#0000ff"></font><font size="2"></font><font size="2" color="#0000ff">Dim</font><font size="2"> myCommand </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">New</font><font size="2"> SqlCommand(strQuery, myConn)</font><font size="2">myConn.Open()</font><font size="2"></font><font size="2" color="#0000ff">Dim</font><font size="2"> myReader </font><font size="2" color="#0000ff">As</font><font size="2"> SqlDataReader = myCommand.ExecuteReader()</font><font size="2">myReader.Read()</font><font size="2">value = myReader.GetString(1)</font><font size="2">myReader.Close()</p>
<p>myConn.Close()</p>
<p><font size="2" color="#0000ff">Return</font><font size="2"> value</font><font size="2"><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">Function</font></font><font size="2"><font size="2" color="#0000ff"> </font><font size="2" color="#0000ff"><font size="3" color="#000000">Now, however, I am working on the administrative part of the web site, and I want a different master page for my admin pages.  Since the admin is still part of the same application, I am going to try to create a BasePage class that all of the user pages of my application can use, but the admin pages will have the master page hard coded and not use the BasePage class.  </font></font></font></p>
<p></font>The way I did it is to take the code out of the web.config for the HttpModule, and create the following Base Page Class in the App_Code Directory.</p>
<p><font size="2" color="#0000ff">Imports<font size="2"> Microsoft.VisualBasic</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Data</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Collections</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Configuration</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.Security</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.UI</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.UI.Adapters</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.UI.WebControls</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.UI.WebControls.WebParts</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Web.UI.HtmlControls</font></p>
<p></font><font size="2" color="#0000ff">Imports<font size="2"> System.Data.SqlClient</font></p>
<p></font><font size="2" color="#0000ff">Public</font><font size="2"> </font><font size="2" color="#0000ff">Class</font><font size="2"> BasePage</font><font size="2"><font size="2" color="#0000ff">Inherits</font><font size="2"> Page</font></p>
<p></font><font size="2" color="#0000ff">Public</font><font size="2"> </font><font size="2" color="#0000ff">Sub</font><font size="2"> Page_PreInit(</font><font size="2" color="#0000ff">ByVal</font><font size="2"> sender </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">Object</font><font size="2">, </font><font size="2" color="#0000ff">ByVal</font><font size="2"> e </font><font size="2" color="#0000ff">As</font><font size="2"> EventArgs) </font><font size="2" color="#0000ff">Handles</font><font size="2"> </font><font size="2" color="#0000ff">Me</font><font size="2">.PreInit</font><font size="2"><font size="2" color="#0000ff">Dim</font><font size="2"> template </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font></p>
<p></font><font size="2"></font><font size="2" color="#0000ff">Dim</font><font size="2"> connStr </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font><font size="2"> = ConfigurationManager.ConnectionStrings(</font><font size="2" color="#a31515">&#8220;TobetConnectionString&#8221;</font><font size="2">).ConnectionString</font><font size="2"><font size="2" color="#0000ff">Dim</font><font size="2"> myConn </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">New</font><font size="2"> SqlConnection(connStr)<font size="2" color="#0000ff">Dim</font><font size="2"> strQuery </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font><font size="2"> = </font><font size="2" color="#a31515">&#8220;select top 1 [ID], [Template] From [SiteConfig]&#8220;</font></p>
<p></font></p>
<p></font><font size="2"></font><font size="2" color="#0000ff">Dim</font><font size="2"> myCommand </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">New</font><font size="2"> SqlCommand(strQuery, myConn)</font><font size="2">myConn.Open()</p>
<p></font><font size="2" color="#0000ff">Dim</font><font size="2"> myReader </font><font size="2" color="#0000ff">As</font><font size="2"> SqlDataReader = myCommand.ExecuteReader()</font><font size="2">myReader.Read()</p>
<p>template = myReader.GetString(1)</p>
<p>myReader.Close()</p>
<p>myConn.Close()</p>
<p><font size="2" color="#0000ff">Me</font><font size="2">.MasterPageFile = template &amp; </font><font size="2" color="#a31515">&#8220;.master&#8221;</font></p>
<p></font><font size="2"></font><font size="2" color="#0000ff">Me</font><font size="2">.Theme = template</font><font size="2"><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">SubEnd<font size="2"> </font><font size="2" color="#0000ff">Class</font></p>
<p></font></p>
<p></font><font size="2">Then in all the pages that I need to use this master page and theme I changed the codebehind file to inherit from BasePage instead of <font size="2"></font><font size="2">System.Web.UI.Page. </p>
<p></font></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=11&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/04/04/pre-init-handling/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Terms of Use checkbox validation in a gridview</title>
		<link>http://dotnetmamma.wordpress.com/2008/03/20/terms-of-use-checkbox-validation-in-a-gridview/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/03/20/terms-of-use-checkbox-validation-in-a-gridview/#comments</comments>
		<pubDate>Thu, 20 Mar 2008 03:14:06 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[.aspx]]></category>
		<category><![CDATA[Code Behind]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[checkbox]]></category>
		<category><![CDATA[custom validator]]></category>
		<category><![CDATA[gridview]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=9</guid>
		<description><![CDATA[I was trying to validate that a checkbox was checked using a custom code validator in a gridview.  I kept getting the error:  Exception Details: System.NullReferenceException: Object reference not set to an instance of an object. This was the original code which was the same as the code I used when validating a checkbox on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=9&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was trying to validate that a checkbox was checked using a custom code validator in a gridview.  I kept getting the error:</p>
<p> <strong>Exception Details: </strong>System.NullReferenceException: Object reference not set to an instance of an object.</p>
<p>This was the original code which was the same as the code I used when validating a checkbox on a formview:</p>
<p><font size="2"><font color="#0000ff">Public</font><font color="#000000"> </font><font color="#0000ff">Sub</font><font color="#000000"> ValidateTerms(</font><font color="#0000ff">ByVal</font><font color="#000000"> sender </font><font color="#0000ff">As</font><font color="#000000"> System.Object, </font><font color="#0000ff">ByVal</font><font color="#000000"> args </font><font color="#0000ff">As</font><font color="#000000"> ServerValidateEventArgs)</font></font></p>
<blockquote><p><font size="2"><font color="#0000ff">If</font> <font color="#0000ff">CType</font>(<font color="#0000ff">Me</font>.GridView1.FindControl(<font color="#a31515">&#8220;TermsOfUse&#8221;</font>), CheckBox).Checked <font color="#0000ff">Then</font></font></p></blockquote>
<blockquote>
<blockquote><p><font size="2">args.IsValid = <font color="#0000ff">True</font></font></p></blockquote>
</blockquote>
<blockquote><p><font size="2"><font color="#0000ff">Else</font> : args.IsValid = <font color="#0000ff">False</font></font></p></blockquote>
<blockquote><p><font size="2"><font color="#0000ff">End</font> <font color="#0000ff">If</font></font></p></blockquote>
<p><font size="2"><font color="#0000ff">End</font> <font color="#0000ff">Sub</font></font></p>
<p><font size="+0">I found this thread on <a target="_blank" href="http://forums.asp.net/t/1120309.aspx">forums.asp.net </a>that helped me come up with the following code that worked:</font></p>
<p><font size="2" color="#0000ff">Public<font size="2"> </font><font size="2" color="#0000ff">Sub</font><font size="2"> ValidateTerms(</font><font size="2" color="#0000ff">ByVal</font><font size="2"> sender </font><font size="2" color="#0000ff">As</font><font size="2"> System.Object, </font><font size="2" color="#0000ff">ByVal</font><font size="2"> args </font><font size="2" color="#0000ff">As</font><font size="2"> ServerValidateEventArgs)</font></font><font size="2" color="#0000ff"><font size="2"></font></font><font size="2" color="#0000ff"><font size="2"></p>
<blockquote><p><font size="2" color="#0000ff">Dim</font><font size="2"> cv </font><font size="2" color="#0000ff">As</font><font size="2"> CustomValidator = sender</font><font size="2"></p>
<blockquote><p><font size="2" color="#0000ff">Dim</font><font size="2"> row </font><font size="2" color="#0000ff">As</font><font size="2"> GridViewRow = cv.NamingContainer</font><font size="2"></font><font size="2"></p>
<blockquote><p><font size="2" color="#0000ff">Dim</font><font size="2"> chkBox </font><font size="2" color="#0000ff">As</font><font size="2"> CheckBox = row.FindControl(</font><font size="2" color="#a31515">&#8220;TermsOfUse&#8221;</font><font size="2">)</p>
<blockquote>
<blockquote><p><font size="2" color="#0000ff">If</font><font size="2"> (chkBox.Checked) </font><font size="2" color="#0000ff">Then</font></p></blockquote>
</blockquote>
<p></font></p></blockquote>
<p></font></p></blockquote>
<p></font></p></blockquote>
<p></font></font><font size="2"></font><font size="2"></font><font size="2"></p>
<blockquote>
<blockquote>
<blockquote><p>args.IsValid = <font size="2" color="#0000ff">True</font></p></blockquote>
</blockquote>
</blockquote>
<p></font><font size="2"></font><font size="2"></font><font size="2"></p>
<blockquote>
<blockquote><p><font size="2" color="#0000ff">Else</font><font size="2"> : args.IsValid = </font><font size="2" color="#0000ff">False</font></p></blockquote>
</blockquote>
<p></font><font size="2"></font><font size="2"></font><font size="2"></p>
<blockquote>
<blockquote><p><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">If</font></p></blockquote>
</blockquote>
<p><font size="2"><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">Sub</font></font></p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=9&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/03/20/terms-of-use-checkbox-validation-in-a-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Formatting a date declaratively</title>
		<link>http://dotnetmamma.wordpress.com/2008/02/08/formatting-a-date-declaratively/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/02/08/formatting-a-date-declaratively/#comments</comments>
		<pubDate>Fri, 08 Feb 2008 17:05:28 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[.aspx]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[declarative formatting]]></category>
		<category><![CDATA[format date]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=8</guid>
		<description><![CDATA[I have a label bound to a DateTime field in my SQL Server Database.  When I enter the data into the field I only enter in the date in mm/dd/yyyy format.  However, since it is a DateTime field, SQL Server automatically adds the time.  Therefore when it shows on my site it shows the date and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=8&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a label bound to a DateTime field in my SQL Server Database.  When I enter the data into the field I only enter in the date in mm/dd/yyyy format.  However, since it is a DateTime field, SQL Server automatically adds the time.  Therefore when it shows on my site it shows the date and the time like this :</p>
<p> Event Date: 03/13/2008 12:00:00PM</p>
<p>I just wanted to show the date so instead of setting </p>
<p><font size="2" color="#ff0000">Text</font><font size="2" color="#0000ff">=&#8217;</font><font size="2">&lt;%# Eval(&#8220;EventDate&#8221;) %&gt;</font><font size="2" color="#0000ff">&#8216; </font></p>
<p>which give the above results,  I did the following:</p>
<p><font size="2" color="#0000ff"><font size="2" color="#ff0000">Text<font size="2" color="#0000ff">=&#8217;</font><font size="2" color="#000000">&lt;%# DataBinder.Eval(Container.DataItem,&#8221;EventDate&#8221;, &#8220;{0:MM/dd/yyyy}&#8221; ) %&gt;</font><font size="2" color="#0000ff">&#8216;</font></font></font></p>
<p>This gave me the results I was looking for where</p>
<p><font size="2" color="#0000ff"><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="3" color="#000000">Event Date:</font> <font size="3" color="#000000">03/13/2008 </font></font></font></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=8&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/02/08/formatting-a-date-declaratively/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Return the value of the ID field after updating database</title>
		<link>http://dotnetmamma.wordpress.com/2008/01/25/return-the-value-of-the-id-field-after-updating-database/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/01/25/return-the-value-of-the-id-field-after-updating-database/#comments</comments>
		<pubDate>Fri, 25 Jan 2008 17:43:38 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[Code Behind]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Identity]]></category>
		<category><![CDATA[insert]]></category>
		<category><![CDATA[return id field]]></category>
		<category><![CDATA[Scope_Identity()]]></category>
		<category><![CDATA[set command]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/?p=7</guid>
		<description><![CDATA[Serveral times I have done an insert or update on the database and then needed to know the automatically generated id of the record.  One of the reasons I need it was to do a Response.Redirect to the a page that displays the data that I just inserted or edited.  Another reason is after inserting [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=7&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Serveral times I have done an insert or update on the database and then needed to know the automatically generated id of the record.  One of the reasons I need it was to do a Response.Redirect to the a page that displays the data that I just inserted or edited.  Another reason is after inserting a record, I needed to update the url field of the same record where the url contains that automatically generated ID.  This is how I am setting up my content management system that I am working on for a non profit organization.  I found a great article that tells what needs to be done to return a value that was just inserted.  Here is the article.</p>
<p> <a href="http://www.mikesdotnetting.com/Article.aspx?ArticleID=54"><font size="3" color="#800080" face="Times New Roman">http://www.mikesdotnetting.com/Article.aspx?ArticleID=54</font></a></p>
<p>I was using a FormView control with a SQLDataSource.<span>  </span><font size="3" face="Times New Roman"> </font></p>
<p><font size="3" face="Times New Roman">The table I am inserting into has the following fields</font></p>
<p><font size="3" face="Times New Roman"> </font> <font size="3" face="Times New Roman">ID</font></p>
<p><font size="3" face="Times New Roman">GroupName</font></p>
<p><font size="3" face="Times New Roman">Email</font></p>
<p><font size="3" face="Times New Roman">Website</font></p>
<p><font size="3" face="Times New Roman">Location</font></p>
<p><font size="3" face="Times New Roman">ContactPhone</font></p>
<p><font size="3" face="Times New Roman">LastUpdated</font></p>
<p><font size="3" face="Times New Roman">DateTime</font></p>
<p style="margin:0;" class="MsoNormal"><font size="3" face="Times New Roman">Description</font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><font face="Times New Roman"></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3" face="Times New Roman">OriginalEmail</font></p>
<p style="margin:0;" class="MsoNormal">&nbsp;</p>
<p style="margin:0;" class="MsoNormal"><font size="3" face="Times New Roman"> </font><font size="3" face="Times New Roman">The InsertCommand is as follows: </font><span style="font-size:10pt;color:blue;font-family:'Courier New';">&#8220;INSERT INTO [tblTalks] ([GroupName], [Email], [Location], [ContactPhone], [LastUpdated], [DateTime], [Description], [OriginalEmail]) Values (@GroupName, @Email,  @Location, @ContactPhone, GetDate(), @DateTime, @Description, @Email)&#8221;</span><span style="font-size:10pt;color:blue;font-family:'Courier New';"> </span></p>
<p style="margin:0;" class="MsoNormal"><span style="font-size:10pt;color:blue;font-family:'Courier New';"></span></p>
<p style="margin:0;" class="MsoNormal"><span style="font-size:10pt;color:blue;font-family:'Courier New';"></span><span style="font-size:10pt;color:blue;font-family:'Courier New';"><font size="3" color="#000000" face="Times New Roman">The ID field auto increments when the record is added.  </font></span> </p>
<p style="margin:0;" class="MsoNormal"><font size="3" face="Times New Roman">What I needed to do was get the ID of the record that was just added so I could update the website field to be similar to this: <span> </span>&#8220;</font><font size="3" face="Times New Roman">http://www.mysite.org/talks.aspx?p</font><font size="3"><font face="Times New Roman">= &#8221; &amp; ID<span>  </span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span>What I ended up doing was adding ;<span style="font-size:10pt;color:blue;font-family:'Courier New';">SET @NewId = Scope_Identity()</span><font size="3"><font face="Times New Roman">to the end of my INSERTCOMMAND.<span> </span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span>Then I added another Parameter to my INSERT PARAMETERS collection that has the DIRECTION set to OUTPUT like this:</span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span>&lt;asp:Parameter Direction=&#8221;Output&#8221; Name=&#8221;NewId&#8221; Type=&#8221;Int32&#8243; /&gt;  </span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span>Now we want to do something with the output parameter that we just created.  This must be done in the Inserted event of the sqldatasource.  So I add the following code in my codebehind.  </span></font></font></span></font></font></p>
<p style="margin:0;" class="MsoNormal"><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2" color="#0000ff">Protected</font><font size="2"> </font><font size="2" color="#0000ff">Sub</font><font size="2"> SqlDataSource1_Inserted(</font><font size="2" color="#0000ff">ByVal</font><font size="2"> sender </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">Object</font><font size="2">, </font><font size="2" color="#0000ff">ByVal</font><font size="2"> e </font><font size="2" color="#0000ff">As</font><font size="2"> SqlDataSourceStatusEventArgs) </font><font size="2" color="#0000ff">Handles</font><font size="2"> SqlDataSource1.Inserted</font></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2"><font size="2" color="#0000ff">     Dim</font><font size="2"> newid </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">Integer</font><font size="2"> = e.Command.Parameters(</font><font size="2" color="#a31515">&#8220;@NewId&#8221;</font><font size="2">).Value</font></font></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2"><font size="2">     Response.Redirect(</font></font></span></font></font></span></font></font><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2"> </font><font size="2" color="#a31515">&#8220;~/StoryBook.aspx?mode=3&amp;ID=&#8221;</font><font size="2"> &amp; newid.ToString())</font></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2"><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">Sub</font></font></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span></span></font></font></span></font></font></p>
<p><font size="3"><font face="Times New Roman"><span><font size="3"><font face="Times New Roman"><span><font size="2"><font size="2" color="#0000ff"></font><font size="2">In this example I just used the output to redirect to a page that would show the data that was just entered.   I could have used the output to update the record I just inserted or any number of other things.  Thanks to Mike at mikesdotnetting for the article above.  In his article he shows how to to this from codebehind as well using both C# and VB.NET, as well as how to do it in Access.  </font></font></span></font></font></span></font></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=7&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/01/25/return-the-value-of-the-id-field-after-updating-database/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Using querystring parameters</title>
		<link>http://dotnetmamma.wordpress.com/2008/01/22/using-querystring-parameters/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/01/22/using-querystring-parameters/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 05:13:39 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[.aspx]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[parameter]]></category>
		<category><![CDATA[querystring]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/2008/01/22/using-querystring-parameters/</guid>
		<description><![CDATA[This is a simple one but I just want to put it here to remind myself.  If url is as following: http://www.mysite.org/page.aspx?id=1  Then you must have a querystring parameter for your datasource.  In this case it is for the select statement. &#60;SelectParameters&#62; &#60;asp:QueryStringParameterName=&#8221;ID&#8221;QueryStringField=&#8221;ID&#8221;/&#62; &#60;/SelectParameters&#62; Then you select statement is as follows. SelectCommand=&#8221;Select [Field1],[Field2] From [table] [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=6&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is a simple one but I just want to put it here to remind myself.  If url is as following:</p>
<p>http://www.mysite.org/page.aspx?id=1</p>
<p> Then you must have a querystring parameter for your datasource.  In this case it is for the select statement.</p>
<p><font size="2" color="#0000ff">&lt;<font size="2" color="#a31515">SelectParameters</font><font size="2" color="#0000ff">&gt;</font></font></p>
<p><font size="2" color="#0000ff"><font size="2" color="#0000ff">&lt;</font><font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">QueryStringParameter</font></font><font size="2" color="#0000ff"><font size="2"></font><font size="2" color="#ff0000">Name</font><font size="2" color="#0000ff">=&#8221;ID&#8221;</font></font><font size="2" color="#0000ff"><font size="2" color="#ff0000">QueryStringField</font><font size="2" color="#0000ff">=&#8221;ID&#8221;</font><font size="2" color="#0000ff">/&gt;</font></font></p>
<p><font size="2" color="#0000ff"><font size="2" color="#0000ff">&lt;/</font><font size="2" color="#a31515">SelectParameters</font><font size="2" color="#0000ff">&gt;</font></font><font size="2" color="#0000ff"> </font></p>
<p><font size="2" color="#0000ff"><font size="2" color="#0000ff"></font><font size="2" color="#0000ff"><font size="3" color="#000000">Then you select statement is as follows.</font></font></font><font size="2" color="#0000ff"> </font><font size="2" color="#0000ff"><font size="2" color="#0000ff"><font size="2" color="#ff0000">SelectCommand<font size="2" color="#0000ff">=&#8221;Select [Field1],[Field2] From [table] Where [idfield] = @ID&#8221;</font></font></font></p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=6&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/01/22/using-querystring-parameters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically set Hyperlink NavigateUrl property within a Gridview</title>
		<link>http://dotnetmamma.wordpress.com/2008/01/22/dynamically-set-hyperlink-navigateurl-property-within-a-gridview/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/01/22/dynamically-set-hyperlink-navigateurl-property-within-a-gridview/#comments</comments>
		<pubDate>Tue, 22 Jan 2008 04:48:15 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[Controls]]></category>
		<category><![CDATA[.aspx]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[dynamic]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[hyperlink control]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/2008/01/22/dynamically-set-hyperlink-navigateurl-property-within-a-gridview/</guid>
		<description><![CDATA[I wanted to set my NavigateUrl Property to go to a different page and pass a querystring variable called ID that was retrieved from the database.  This is the solution &#60;asp:HyperLink ID=&#8221;LinkStory&#8221; runat=&#8221;server&#8221; NavigateUrl=&#8217;&#60;%# Eval(&#8220;StoryID&#8221;, &#8220;StoryBook.aspx?mode=3&#38;ID={0}&#8221;) %&#62;&#8216; Text=&#8217;&#60;%# Eval(&#8220;Title&#8221;) %&#62;&#8216; Width=&#8221;218px&#8221;&#62;&#60;/asp:HyperLink&#62; I found this on the codenewsgroups forum. here is the link: http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic9795.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=5&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I wanted to set my NavigateUrl Property to go to a different page and pass a querystring variable called ID that was retrieved from the database.  This is the solution</p>
<p><font size="2" color="#0000ff">&lt;<font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">HyperLink</font><font size="2"> </font><font size="2" color="#ff0000">ID</font><font size="2" color="#0000ff">=&#8221;LinkStory&#8221;</font><font size="2"> </font><font size="2" color="#ff0000">runat</font><font size="2" color="#0000ff">=&#8221;server&#8221;</font><font size="2"> </font><font size="2" color="#ff0000">NavigateUrl</font><font size="2" color="#0000ff">=&#8217;</font><font size="2">&lt;%# Eval(&#8220;StoryID&#8221;, &#8220;StoryBook.aspx?mode=3&amp;ID={0}&#8221;) %&gt;</font><font size="2" color="#0000ff">&#8216;</font></p>
<p></font><font size="2"><font size="2" color="#ff0000">Text</font><font size="2" color="#0000ff">=&#8217;</font><font size="2">&lt;%# Eval(&#8220;Title&#8221;) %&gt;</font><font size="2" color="#0000ff">&#8216;</font><font size="2"> </font><font size="2" color="#ff0000">Width</font><font size="2" color="#0000ff">=&#8221;218px&#8221;&gt;&lt;/</font><font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">HyperLink</font><font size="2" color="#0000ff">&gt;</font></p>
<p></font><font size="2" color="#0000ff"><font size="3" color="#000000">I found this on the codenewsgroups forum. here is the link:</font></font></p>
<p><font size="2" color="#0000ff"><a href="http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic9795.aspx">http://www.codenewsgroups.net/group/microsoft.public.dotnet.framework.aspnet.webcontrols/topic9795.aspx</a></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=5&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/01/22/dynamically-set-hyperlink-navigateurl-property-within-a-gridview/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Change to Edit or New mode of formview from a link on another page</title>
		<link>http://dotnetmamma.wordpress.com/2008/01/21/change-to-edit-or-new-mode-of-formview-from-a-link-on-another-page/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/01/21/change-to-edit-or-new-mode-of-formview-from-a-link-on-another-page/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 17:52:42 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[Code Behind]]></category>
		<category><![CDATA[Controls]]></category>
		<category><![CDATA[Change mode]]></category>
		<category><![CDATA[edit mode]]></category>
		<category><![CDATA[formview]]></category>
		<category><![CDATA[gridview]]></category>
		<category><![CDATA[insert mode]]></category>
		<category><![CDATA[VB.NET]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/2008/01/21/change-to-edit-or-new-mode-of-formview-from-a-link-on-another-page/</guid>
		<description><![CDATA[I have a  page called contents.aspx that contains a Hyperlink Control to add a new record and a gridview that is set up to be a table of contents.  The Hyperlink control needs to open a formview on a different .aspx page in New mode.  To do this I pass a variable in the URL to the page [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=4&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a  page called contents.aspx that contains a Hyperlink Control to add a new record and a gridview that is set up to be a table of contents.  The Hyperlink control needs to open a formview on a different .aspx page in New mode.  To do this I pass a variable in the URL to the page Called story.aspx with the formview and handle it in the Code Behind.   First I set NavigateURL property of the Hyperlink Control on contents contents.aspx like this: </p>
<p><font size="2" color="#ff0000"></font><font size="2" color="#ff0000">NavigateUrl<font size="2" color="#0000ff">=&#8221;~/StoryBook.aspx?mode=0&#8243;&gt;</font><font size="2">Add My Story</font><font size="2" color="#0000ff">&lt;/</font><font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">HyperLink</font><font size="2" color="#0000ff">&gt;</font></font><font size="2" color="#ff0000"><font size="2" color="#0000ff"> </font></font></p>
<p><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="3" color="#000000">Then in the codebehind of the of story.aspx I put the following code in the Page Load Event:</font></font></font><font size="2" color="#ff0000"> </font></p>
<p><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="3" color="#000000"><font size="2" color="#0000ff">If<font size="2"> mode = </font><font size="2" color="#a31515">&#8220;0&#8243;</font><font size="2"> </font><font size="2" color="#0000ff">Then</font></font></font></font></font></p>
<p><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="3" color="#000000"><font size="2" color="#0000ff"></font><font size="2">FormView1.ChangeMode(FormViewMode.Insert)</font></font></font></font></p>
<p><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="2"><font size="2" color="#0000ff">ElseIf</font><font size="2"> mode = </font><font size="2" color="#a31515">&#8220;1&#8243;</font><font size="2"> </font><font size="2" color="#0000ff">Then</font></font></font></font></p>
<p><font size="2" color="#ff0000"><font size="2" color="#0000ff"><font size="2">FormView1.ChangeMode(FormViewMode.Edit)</font></font></font></p>
<p><font size="2" color="#ff0000"></font><font size="2"><font size="2" color="#0000ff">End</font><font size="2"> </font><font size="2" color="#0000ff">If</font></font></p>
<p><font size="2">If I wanted the page to open in edit view, I would have set the NavigateURL property in contents.aspx to be</font><font size="2"> </font><font size="2"><font size="2" color="#0000ff">NavigateUrl<font size="2" color="#0000ff">=&#8221;~/StoryBook.aspx?mode=1&#8243;&gt;</font><font size="2" color="#000000">Edit My Story</font><font size="2" color="#0000ff">&lt;/</font><font size="2" color="#a31515">asp</font><font size="2" color="#0000ff">:</font><font size="2" color="#a31515">HyperLink</font><font size="2" color="#0000ff">&gt;</font></font></font><font size="2">Here is the link to the site that let me to this conclusion:</p>
<p><a href="http://www.crossedconnections.org/w/?p=70">http://www.crossedconnections.org/w/?p=70</a></p>
<p></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=4&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/01/21/change-to-edit-or-new-mode-of-formview-from-a-link-on-another-page/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
		<item>
		<title>Referencing Controls within a Formview</title>
		<link>http://dotnetmamma.wordpress.com/2008/01/21/referencing-controls-within-a-gridview-or-formview/</link>
		<comments>http://dotnetmamma.wordpress.com/2008/01/21/referencing-controls-within-a-gridview-or-formview/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 17:09:22 +0000</pubDate>
		<dc:creator>dotnetmamma</dc:creator>
				<category><![CDATA[Code Behind]]></category>
		<category><![CDATA[Controls]]></category>

		<guid isPermaLink="false">http://dotnetmamma.wordpress.com/2008/01/21/referencing-controls-within-a-gridview-or-formview/</guid>
		<description><![CDATA[Reference a control that is inside a formview you must use the FindControl method of the System.Web.UI.Control class.  Here is an example: Dim idvar As String = CType(FormView1.FindControl(&#8220;HiddenStoryID&#8221;), HiddenField).Value  Here I am setting the value of the variable idvar equal to the value of the Hidden Field named HiddenStoryID.  You must use the CType to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=3&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Reference a control that is inside a formview you must use the FindControl method of the System.Web.UI.Control class.  Here is an example:</p>
<p><font size="2" color="#0000ff">Dim<font size="2"> idvar </font><font size="2" color="#0000ff">As</font><font size="2"> </font><font size="2" color="#0000ff">String</font><font size="2"> = </font><font size="2" color="#0000ff">CType</font><font size="2">(FormView1.FindControl(</font><font size="2" color="#a31515">&#8220;HiddenStoryID&#8221;</font><font size="2">), HiddenField).Value</font></font><font size="2" color="#0000ff"><font size="2"> </font></font></p>
<p><font size="2" color="#0000ff"><font size="2">Here I am setting the value of the variable idvar equal to the value of the Hidden Field named HiddenStoryID.  You must use the CType to make sure that it is converted correctly when using vb.net.  See <a target="_blank" href="http://msdn2.microsoft.com/en-us/library/4x2877xb(VS.80).aspx" title="MSDN CType">MSDN</a> for details</font></font><font size="2" color="#0000ff">This only seems to work for some controls.  It does not seem to work for a hyperlink control.  I am working on another solution for getting the value from the hyperlink in a GridView.  Right now the most likely seems to be to make it a templated field.  I will post again when I find the answer. </font><font size="2" color="#0000ff"> </font><font size="2" color="#0000ff"><font size="2"></font><font size="2"></font></font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/dotnetmamma.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/dotnetmamma.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/dotnetmamma.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/dotnetmamma.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/dotnetmamma.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=dotnetmamma.wordpress.com&amp;blog=2565799&amp;post=3&amp;subd=dotnetmamma&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://dotnetmamma.wordpress.com/2008/01/21/referencing-controls-within-a-gridview-or-formview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/95aed22c174d5aebfdac86293595d78e?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">dotnetmamma</media:title>
		</media:content>
	</item>
	</channel>
</rss>
