<?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>C# lovers Blog</title>
	<atom:link href="http://baimey.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://baimey.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Tue, 22 Mar 2011 06:19:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='baimey.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>C# lovers Blog</title>
		<link>http://baimey.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://baimey.wordpress.com/osd.xml" title="C# lovers Blog" />
	<atom:link rel='hub' href='http://baimey.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Paging and Sorting in GridView without using Datasource control</title>
		<link>http://baimey.wordpress.com/2010/03/08/paging-and-sorting-in-gridview-without-using-datasource-control/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/paging-and-sorting-in-gridview-without-using-datasource-control/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 11:46:31 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[No Datasource]]></category>
		<category><![CDATA[Paging]]></category>
		<category><![CDATA[Sorting]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/paging-and-sorting-in-gridview-without-using-datasource-control/</guid>
		<description><![CDATA[Paging and Sorting in Gridview can be enabled in an ASP.NET by handling the PageIndexChanging and Sorting events of the Gridview ASP.NET   In the web page add the gridview from the toolbox &#60;asp:GridView ID=&#8221;gridView&#8221; OnPageIndexChanging=&#8221;gridView_PageIndexChanging&#8221;  OnSorting=&#8221;gridView_Sorting&#8221; runat=&#8221;server&#8221; /&#62;   Code Behind   I have a function ConvertSortDirection to display the direction of sort. private [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=34&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Paging and Sorting in Gridview can be enabled in an ASP.NET by handling the PageIndexChanging and Sorting events of the Gridview
</p>
<h1>ASP.NET<br />
</h1>
<p>
 </p>
<p>In the web page add the gridview from the toolbox<span style="color:blue;font-family:Courier New;font-size:10pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:brown;">asp</span><span style="color:blue;">:</span><span style="color:brown;">GridView</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;gridView&#8221;</span><br />
			<span style="color:red;">OnPageIndexChanging</span><span style="color:blue;">=&#8221;gridView_PageIndexChanging&#8221;</span> </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">OnSorting</span><span style="color:blue;">=&#8221;gridView_Sorting&#8221;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221; /&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;">
 </p>
<h1>Code Behind<br />
</h1>
<p style="background:white;">
 </p>
<p>I have a function ConvertSortDirection to display the direction of sort.
</p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">private string</span> ConvertSortDirection(<span style="color:teal;">SortDirection</span> sortDireciton)<br />{<br />   <span style="color:blue;">string</span> newSortDirection = <span style="color:teal;">String</span>.Empty;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">switch</span> (sortDirection)<br />   {<br />      <span style="color:blue;">case</span><br />
			<span style="color:teal;">SortDirection</span>.Ascending:<br />         newSortDirection = <span style="color:brown;">&#8220;ASC&#8221;</span>;<br />         <span style="color:blue;">break</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">      <span style="color:blue;">case</span><br />
			<span style="color:teal;">SortDirection</span>.Descending:<br />         newSortDirection = <span style="color:brown;">&#8220;DESC&#8221;</span>;<br />         <span style="color:blue;">break</span>;<br />   }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">return</span> newSortDirection<br />}<br />
</span></p>
<p style="background:white;">
 </p>
<h2>PageIndexChanging<span style="color:blue;"><br />
		</span></h2>
<p style="background:white;">
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected void</span> gridView_PageIndexChanging(<span style="color:blue;">object</span> sender, <span style="color:teal;">GridViewPageEventArgs</span> e)<br />{<br />   gridView.PageIndex = e.NewPageIndex;<br />   gridView.DataBind();<br />}<br />
</span></p>
<p style="background:white;">
 </p>
<h2>Sorting<br />
</h2>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected void</span> gridView_Sorting(<span style="color:blue;">object</span> sender, <span style="color:teal;">GridViewSortEventArgs</span> e)<br />{<br />   <span style="color:teal;">DataTable</span> dataTable = gridView.DataSource <span style="color:blue;">as</span><br />
			<span style="color:teal;">DataTable</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">if</span> (dataTable != <span style="color:blue;">null</span>)<br />   {<br />      <span style="color:teal;">DataView</span> dataView = <span style="color:blue;">new</span><br />
			<span style="color:teal;">DataView</span>(dataTable);<br />      dataView.Sort = e.SortExpression + <span style="color:brown;">&#8221; &#8220;</span> + ConvertSortDirectionToSql(e.SortDirection);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">      gridView.DataSource = dataView;<br />      gridView.DataBind();<br />   }<br />}<br />
</span></p>
<p style="background:white;">
 </p>
<p style="background:white;"><span style="font-size:10pt;"><span style="font-family:Courier New;">Happy coding </span><span style="font-family:Wingdings;">J</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/34/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/34/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/34/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=34&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/paging-and-sorting-in-gridview-without-using-datasource-control/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>Deleting Multiple Rows in a GridView</title>
		<link>http://baimey.wordpress.com/2010/03/08/deleting-multiple-rows-in-a-gridview/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/deleting-multiple-rows-in-a-gridview/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 11:30:29 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[Multi row delete]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/deleting-multiple-rows-in-a-gridview/</guid>
		<description><![CDATA[    A gridview allows us to delete only a single row at a time. We will extend this functionality to select multiple rows and delete all of the selected rows in a single stroke. In this article, I assume that you are aware of creating asp.net web applications and have worked with gridview. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=32&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;"> A gridview allows us to delete only a single row at a time. We will extend this functionality to select multiple rows and delete all of the selected rows in a single stroke. In this article, I assume that you are aware of creating asp.net web applications and have worked with gridview.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">The sample makes use of the Northwind database. We will be pulling data from the Employee table. For this sample to work, drop all the Foreign Key relationships on the Employee Table. To do so, in Sql Server Management Studio, browse to the Northwind database and open the Employee table in design view. Right click in the Table designer on the right hand side and choose &#8216;Relationships&#8217;. Select all the relationships like FK_Orders_Employees,  FK_EmployeeTerritories_Employees etc and delete them. This step is necessary as we will get a constraint violation exception if we do not do so.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">Once we are through with the task of removing the relationships in the Employee table, let us explore the steps to create a gridview with functionality to delete multiple rows at a time.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">Perform the following steps :</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;"><strong>Step 1:</strong> Create an .aspx page and add a GridView and a SqlDataSource control to it.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;"><strong>Step 2:</strong> Configure the connection of SqlDataSource to point to the Northwind database.  Create queries for the Select and Delete commands. The resultant code will look similar as given below :</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;SqlDataSource1&#8243;</span><br />
			<span style="color:red;">Runat</span><span style="color:blue;">=&#8221;server&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    <span style="color:red;">SelectCommand</span><span style="color:blue;">=&#8221;SELECT EmployeeID, LastName, City FROM Employees&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    <span style="color:red;">DeleteCommand</span><span style="color:blue;">=&#8221;DELETE FROM Employees WHERE [EmployeeID] = @EmployeeID&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    <span style="color:red;">ConnectionString</span><span style="color:blue;">=&#8221;</span><span style="background-color:yellow;">&lt;%</span>$ ConnectionStrings:NorthwindConnectionString <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8220;</span><br />
			<span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">       <span style="color:blue;">&lt;</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">           <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;EmployeeID&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">       <span style="color:blue;">&lt;/</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><span style="color:blue;">&gt;                                    </span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;"><strong>Step 3:</strong> Once the SqlDataSource has been configured, bind the gridview with this data source.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;"><strong>Step 4:</strong> To create a checkbox in each row, follow these steps:</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;font-size:10pt;">1.</span><span style="font-family:Times New Roman;font-size:7pt;">    </span><span style="font-family:Verdana;"><span style="font-size:10pt;">Create a TemplateField inside the <span style="color:blue;">&lt;</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;</span> to add custom content to each column.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;font-size:10pt;">2.</span><span style="font-family:Times New Roman;font-size:7pt;">    </span><span style="font-family:Verdana;"><span style="font-size:10pt;">Inside the TemplateField, create an ItemTemplate with a CheckBox added to it. </span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">       <span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">             <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">CheckBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;chkRows&#8221;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">      <span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;"> &lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="color:black;font-size:10pt;">This will add a checkbox to each row in the grid.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="color:black;font-size:10pt;"><strong>Step 5:</strong> Add a button control, and rename it to btnMultipleRowDelete.</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">The resultant markup in the design view will look similar to the code below :</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;GridView1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">AutoGenerateColumns</span><span style="color:blue;">=&#8221;False&#8221;</span><br />
			<span style="color:red;">DataKeyNames</span><span style="color:blue;">=&#8221;EmployeeID&#8221; </span><span style="color:red;">DataSourceID</span><span style="color:blue;">=&#8221;SqlDataSource1&#8243;&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;">  <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">&lt;</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">      <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">          <span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">CheckBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;cbRows&#8221;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">          <span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">       <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
			<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;EmployeeID&#8221;</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;EmployeeID&#8221;</span><br />
			<span style="color:red;">InsertVisible</span><span style="color:blue;">=&#8221;False&#8221; </span><span style="color:red;">ReadOnly</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;EmployeeID&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
			<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;LastName&#8221;</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;LastName&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;LastName&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
			<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;City&#8221;</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;City&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;City&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">&lt;/</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;SqlDataSource1&#8243;</span><br />
			<span style="color:red;">Runat</span><span style="color:blue;">=&#8221;server&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">SelectCommand</span><span style="color:blue;">=&#8221;SELECT EmployeeID, LastName, City FROM Employees&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">DeleteCommand</span><span style="color:blue;">=&#8221;DELETE FROM Employees WHERE [EmployeeID] = @EmployeeID&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">ConnectionString</span><span style="color:blue;">=&#8221;</span><span style="background-color:yellow;">&lt;%</span>$ ConnectionStrings:NorthwindConnectionString <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8220;</span><br />
			<span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">&lt;</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">       <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;EmployeeID&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:blue;">&lt;/</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Button</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:red;">ID</span><span style="color:blue;">=&#8221;btnMultipleRowDelete&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:red;">OnClick</span><span style="color:blue;">=&#8221;btnMultipleRowDelete_Click&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">   <span style="color:red;">Text</span><span style="color:blue;">=&#8221;Delete Rows&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">In Code behind file (.cs) for C# and (.vb) for VB.NET, code the button click event. Our code will first loop through all the rows in the GridView. If a row is checked, the code retrieves the EmployeeID and passes the selected value to the Delete Command. </span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">C#</span><span style="font-size:9pt;"><br />
			</span></span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected</span><br />
			<span style="color:blue;">void</span> btnMultipleRowDelete_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">{</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:green;">// Looping through all the rows in the GridView</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">foreach</span> (<span style="color:#2b91af;">GridViewRow</span> row <span style="color:blue;">in</span> GridView1.Rows)</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        {</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:#2b91af;">CheckBox</span> checkbox = (<span style="color:#2b91af;">CheckBox</span>)row.FindControl(<span style="color:#a31515;">&#8220;cbRows&#8221;</span>);</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:green;">//Check if the checkbox is checked. </span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="color:green;font-family:Courier New;font-size:10pt;">//value in the HtmlInputCheckBox&#8217;s Value property is set as the //value of the delete command&#8217;s parameter.</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">if</span> (checkbox.Checked)</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            {</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:green;">// Retreive the Employee ID</span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">int</span> employeeID = <span style="color:#2b91af;">Convert</span>.ToInt32(GridView1.DataKeys[row.RowIndex].Value);</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="color:green;font-family:Courier New;font-size:10pt;">// Pass the value of the selected Employye ID to the Delete //command.</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">SqlDataSource1.DeleteParameters[<span style="color:#a31515;">"EmployeeID"</span>].DefaultValue = employeeID.ToString();</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                SqlDataSource1.Delete();</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            }</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        }</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"> }</span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Verdana;font-size:10pt;">Run the code, and select a few rows in the grid. &#8216;Delete Rows&#8217; button, the selected rows get deleted. Rather than deleting rows one at a time, deleting them in a batch is a good practice. I would encourage you to read Scott Mitchell&#8217;s <a href="http://www.asp.net/learn/data-access/tutorial-65-cs.aspx"><span style="color:#4292c6;text-decoration:underline;">article</span></a> for the same.<br />
</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;"><strong>Conclusion</strong></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-size:10pt;"><span style="font-family:Verdana;">By default, the gridview provides the functionality to delete a single row at a time. In this article, we explored how to extend the functionality of the grid view and delete multiple rows. I hope this article was useful and I thank you for viewing</span><span style="font-family:Courier New;"> it. </span></span><span style="font-family:Verdana;font-size:9pt;"><br />
		</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=32&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/deleting-multiple-rows-in-a-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>Add, Update, Delete Records in a Gridview using SqlDataSource</title>
		<link>http://baimey.wordpress.com/2010/03/08/add-update-delete-records-in-a-gridview-using-sqldatasource/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/add-update-delete-records-in-a-gridview-using-sqldatasource/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 10:29:58 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Add]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[SqlDataSource]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/add-update-delete-records-in-a-gridview-using-sqldatasource/</guid>
		<description><![CDATA[By default, the GridView control doesn&#8217;t have support for inserting new records. However you can use the built-in edit or delete functionality of the GridView control. Let us explore how to insert new records and Update and Delete existing records in Gridview. Just copy and paste the code in your project. We will be using [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=31&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>By default, the GridView control doesn&#8217;t have support for inserting new records. However you can use the built-in edit or delete functionality of the GridView control. Let us explore how to insert new records and Update and Delete existing records in Gridview. Just copy and paste the code in your project. We will be using the &#8216;Categories&#8217; table in the &#8216;Northwind&#8217; database.<span style="font-size:8pt;"><br />
		</span></p>
<p><span style="text-decoration:underline;">GridView.aspx</span><span style="font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;GridView1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">AutoGenerateColumns</span><span style="color:blue;">=&#8221;False&#8221;</span><br />
			<span style="color:red;">DataKeyNames</span><span style="color:blue;">=&#8221;CategoryID&#8221;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:red;">DataSourceID</span><span style="color:blue;">=&#8221;SqlDataSource1&#8243;</span><br />
			<span style="color:red;">ShowFooter</span><span style="color:blue;">=&#8221;true&#8221;</span><br />
			<span style="color:red;">AllowPaging</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
			<span style="color:red;">AllowSorting</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
			<span style="color:red;">OnRowCommand</span><span style="color:blue;">=&#8221;GridView1_RowCommand&#8221;&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;">           <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">CommandField</span><br />
			<span style="color:red;">ShowDeleteButton</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
			<span style="color:red;">ShowEditButton</span><span style="color:blue;">=&#8221;True&#8221;/&gt;</span>                </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;CategoryID&#8221;</span><br />
			<span style="color:red;">InsertVisible</span><span style="color:blue;">=&#8221;False&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;CategoryID&#8221;&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;Label1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Eval(&#8220;CategoryID&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;Label1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Bind(&#8220;CategoryID&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span>                   </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;CategoryName&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;CategoryName&#8221;&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;TextBox1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Bind(&#8220;CategoryName&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;Label2&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Bind(&#8220;CategoryName&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">FooterTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;CategoryNameTextBox&#8221;</span><br />
			<span style="color:red;">Runat</span><span style="color:blue;">=&#8221;server&#8221;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;/</span><span style="color:#a31515;">FooterTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><br />
			<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Description&#8221;</span><br />
			<span style="color:red;">SortExpression</span><span style="color:blue;">=&#8221;Description&#8221;&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;TextBox2&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Bind(&#8220;Description&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">EditItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;Label3&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">Text</span><span style="color:blue;">=&#8217;</span><span style="background-color:yellow;">&lt;%</span># Bind(&#8220;Description&#8221;) <span style="background-color:yellow;">%&gt;</span><span style="color:blue;">&#8216;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Label</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;</span><span style="color:#a31515;">FooterTemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;DescriptionTextBox&#8221;</span><br />
			<span style="color:red;">Runat</span><span style="color:blue;">=&#8221;server&#8221;&gt;&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TextBox</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">&lt;/</span><span style="color:#a31515;">FooterTemplate</span><span style="color:blue;">&gt;</span>                  </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">TemplateField</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">templatefield</span><span style="color:blue;">&gt;</span>                   </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;</span><span style="color:#a31515;">footertemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                              <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">linkbutton</span><br />
			<span style="color:red;">id</span><span style="color:blue;">=&#8221;btnNew&#8221;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">commandname</span><span style="color:blue;">=&#8221;New&#8221;</span><br />
			<span style="color:red;">text</span><span style="color:blue;">=&#8221;New&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                        <span style="color:blue;">&lt;/</span><span style="color:#a31515;">footertemplate</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                  <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">templatefield</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;">               <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;/</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p style="background:white;">
 </p>
<p style="background:white;"><span style="color:blue;font-family:Courier New;font-size:10pt;">//<br />
</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><br />
			<span style="color:red;">ID</span><span style="color:blue;">=&#8221;SqlDataSource1&#8243;</span><br />
			<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
			<span style="color:red;">ConnectionString</span><span style="color:blue;">=&#8221;Data Source=SUPROTIM;Initial Catalog=Northwind;Integrated Security=True&#8221;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:red;">DeleteCommand</span><span style="color:blue;">=&#8221;DELETE FROM [Categories] WHERE [CategoryID] = @CategoryID&#8221;</span><br />
			<span style="color:red;">InsertCommand</span><span style="color:blue;">=&#8221;INSERT INTO [Categories] ([CategoryName], [Description]) VALUES (@CategoryName, @Description)&#8221;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:red;">ProviderName</span><span style="color:blue;">=&#8221;System.Data.SqlClient&#8221;</span><br />
			<span style="color:red;">SelectCommand</span><span style="color:blue;">=&#8221;SELECT [CategoryID], [CategoryName], [Description] FROM [Categories]&#8220;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:red;">UpdateCommand</span><span style="color:blue;">=&#8221;UPDATE [Categories] SET [CategoryName] = @CategoryName, [Description] = @Description WHERE [CategoryID] = @CategoryID&#8221;&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;CategoryID&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;Int32&#8243;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;/</span><span style="color:#a31515;">DeleteParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;</span><span style="color:#a31515;">UpdateParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;CategoryName&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;String&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;Description&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;String&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;CategoryID&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;Int32&#8243;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;/</span><span style="color:#a31515;">UpdateParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;</span><span style="color:#a31515;">InsertParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;CategoryName&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;String&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Parameter</span><br />
			<span style="color:red;">Name</span><span style="color:blue;">=&#8221;Description&#8221;</span><br />
			<span style="color:red;">Type</span><span style="color:blue;">=&#8221;String&#8221;</span><br />
			<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">&lt;/</span><span style="color:#a31515;">InsertParameters</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">SqlDataSource</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;">   <br />
 </p>
<p style="background:white;"> <br />
 </p>
<p><span style="text-decoration:underline;">GridView.aspx.cs<span style="font-size:8pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected</span><br />
			<span style="color:blue;">void</span> GridView1_RowCommand(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">GridViewCommandEventArgs</span> e)</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:#2b91af;">SqlConnection</span> conn = <span style="color:blue;">new</span><br />
			<span style="color:#2b91af;">SqlConnection</span>(</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:#2b91af;">ConfigurationManager</span>.ConnectionStrings[<span style="color:#a31515;">"NorthwindConnectionString"</span>].ConnectionString);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">try</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            <span style="color:blue;">if</span> (e.CommandName.Equals(<span style="color:#a31515;">&#8220;New&#8221;</span>))</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:#2b91af;">LinkButton</span> btnNew = e.CommandSource <span style="color:blue;">as</span><br />
			<span style="color:#2b91af;">LinkButton</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:#2b91af;">GridViewRow</span> row = btnNew.NamingContainer <span style="color:blue;">as</span><br />
			<span style="color:#2b91af;">GridViewRow</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">if</span> (row == <span style="color:blue;">null</span>)</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:blue;">return</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:#2b91af;">TextBox</span> txtCatName = row.FindControl(<span style="color:#a31515;">&#8220;CategoryNameTextBox&#8221;</span>) <span style="color:blue;">as</span><br />
			<span style="color:#2b91af;">TextBox</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:#2b91af;">TextBox</span> txtDescription = row.FindControl(<span style="color:#a31515;">&#8220;DescriptionTextBox&#8221;</span>) <span style="color:blue;">as</span><br />
			<span style="color:#2b91af;">TextBox</span>;                </span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:#2b91af;">SqlCommand</span> cmd = <span style="color:blue;">new</span><br />
			<span style="color:#2b91af;">SqlCommand</span>(</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    <span style="color:#a31515;">&#8220;INSERT INTO [Categories] ([CategoryName], [Description]) VALUES (@CategoryName, @Description)&#8221;</span>,</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    conn);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                cmd.Parameters.AddWithValue(<span style="color:#a31515;">&#8220;CategoryName&#8221;</span>, txtCatName.Text);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                cmd.Parameters.AddWithValue(<span style="color:#a31515;">&#8220;Description&#8221;</span>,txtDescription.Text);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                conn.Open();</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                <span style="color:blue;">if</span> (cmd.ExecuteNonQuery() == 1)</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                    GridView1.DataBind();</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">                }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">catch</span> (<span style="color:#2b91af;">Exception</span> ex)</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"> <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        <span style="color:blue;">finally</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">            conn.Close();</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p><span style="text-decoration:underline;">Web.config<span style="font-size:8pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">connectionStrings</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">            &lt;</span><span style="color:#a31515;">add</span><span style="color:red;">name</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">NorthwindConnectionString</span>&#8220;<span style="color:red;">connectionString</span><span style="color:blue;">=</span>&#8220;<span style="color:blue;">Data Source =.;Integrated Security = SSPI; Initial Catalog=Northwind;</span>&#8220;<span style="color:blue;">/&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;">           <br />
 </p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;/</span><span style="color:#a31515;">connectionStrings</span><span style="color:blue;">&gt;</span></span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=31&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/add-update-delete-records-in-a-gridview-using-sqldatasource/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>Export GridView To Excel</title>
		<link>http://baimey.wordpress.com/2010/03/08/export-gridview-to-excel/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/export-gridview-to-excel/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 10:25:50 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/export-gridview-to-excel/</guid>
		<description><![CDATA[Today it is common trying to export from Gridview in ASP.NET to excel right. Please find below the piece of code that can help you export Gridview details to excel. C# protected void Button1_Click(object sender, EventArgs e)     {         Response.AddHeader(&#8220;content-disposition&#8221;, &#8220;attachment;filename=FileName.xls&#8221;);         Response.Charset = String.Empty;         Response.ContentType = &#8220;application/vnd.xls&#8221;;         System.IO.StringWriter sw = new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=28&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Today it is common trying to export from Gridview in ASP.NET to excel right. Please find below the piece of code that can help you export Gridview details to excel.
</p>
<p style="background:white;"><span style="font-family:Verdana;"><span style="font-size:10pt;">C#</span><span style="font-size:8pt;"><br />
			</span></span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected</span><br />
			<span style="color:blue;">void</span> Button1_Click(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">EventArgs</span> e)</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    {</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        Response.AddHeader(<span style="color:#a31515;">&#8220;content-disposition&#8221;</span>, <span style="color:#a31515;">&#8220;attachment;filename=FileName.xls&#8221;</span>);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        Response.Charset = <span style="color:#2b91af;">String</span>.Empty;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        Response.ContentType = <span style="color:#a31515;">&#8220;application/vnd.xls&#8221;</span>;</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        System.IO.<span style="color:#2b91af;">StringWriter</span> sw = <span style="color:blue;">new</span> System.IO.<span style="color:#2b91af;">StringWriter</span>();</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        System.Web.UI.<span style="color:#2b91af;">HtmlTextWriter</span> hw = <span style="color:blue;">new</span><br />
			<span style="color:#2b91af;">HtmlTextWriter</span>(sw);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        GridView1.RenderControl(hw);</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        Response.Write(sw.ToString());</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">        Response.End();</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Courier New;font-size:10pt;">    }</span><span style="font-family:Verdana;font-size:8pt;"><br />
		</span></p>
<p style="background:white;"><span style="font-family:Verdana;font-size:8pt;"> <br />
</span> </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/28/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/28/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/28/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=28&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/export-gridview-to-excel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>A scrollable ASP.NET Gridview with a fixed header</title>
		<link>http://baimey.wordpress.com/2010/03/08/a-scrollable-asp-net-gridview-with-a-fixed-header/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/a-scrollable-asp-net-gridview-with-a-fixed-header/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:28:00 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[fixed header]]></category>
		<category><![CDATA[Gridview]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/a-scrollable-asp-net-gridview-with-a-fixed-header/</guid>
		<description><![CDATA[  Introduction ASP.NET Gridview has the provision of providing paging, set a particular pagesize etc.. But at times our clients are too adamant to demand for scrollable gridview with a steady header.Gridview as such doesn&#8217;t have a scrollable feature . But still a work around is possible. This is being discussed in this article that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=25&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<table style="border-collapse:collapse;" border="0">
<col>
<tbody valign="top">
<tr>
<td vAlign="middle" style="padding-top:5px;border-top:solid #e0c16b .75pt;"> </td>
</tr>
</tbody>
</table>
</div>
<p><strong><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;">Introduction</span><span style="color:#4c4c4c;font-family:Verdana;font-size:18pt;"><br />
			</span></strong></p>
<p><span style="color:#4c4c4c;font-size:12pt;">ASP.NET Gridview has the provision of providing paging, set a particular pagesize etc.. But at times our clients are too adamant to demand for scrollable gridview with a steady header.Gridview as such doesn&#8217;t have a scrollable feature . But still a work around is possible. This is being discussed in this article that provides us a convenient scrollable grid with a steady header.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><strong><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;">STEP 1- Scrollable GridView</span><span style="color:#4c4c4c;font-family:Verdana;font-size:18pt;"><br />
			</span></strong></p>
<p><span style="color:#4c4c4c;font-size:12pt;">Add the gridview into a asp:Panel control<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Panel</span><span style="color:#4c4c4c;"><br />
			</span><span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><span style="color:#4c4c4c;"><br />
			</span><span style="color:red;">ScrollBars</span><span style="color:blue;">=&#8221;auto&#8221;</span><span style="color:#4c4c4c;"><br />
			</span><span style="color:red;">Width</span><span style="color:blue;">=&#8221;500px&#8221;&gt;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#4c4c4c;">            </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><span style="color:#4c4c4c;"><br />
			</span><span style="color:red;">ID</span><span style="color:blue;">=&#8221;GridView1&#8243;</span><span style="color:#4c4c4c;"><br />
			</span><span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;&gt;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#4c4c4c;">            </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><span style="color:blue;">&gt;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#4c4c4c;">        </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">Panel</span><span style="color:blue;">&gt;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="color:#4c4c4c;font-size:12pt;">This Panel has a scroll bar feature so it tends to scroll the grid. But our problem is not yet solved. What is the next issue- Constant header.<br />The above code makes the whole panel content to scroll. But most of the application needs a constant header. Is it possible? This is explained in the next section<span style="font-family:Times New Roman;"> <br />
</span></span></p>
<p><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;"><strong>STEP 2- Stable header</strong></span><span style="color:#333333;font-family:Verdana;font-size:7pt;"><br />This can be done in 2 ways</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="color:#333333;font-family:Verdana;font-size:7pt;">1. Add the css to the Panel</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">01..fixedHeader </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">02. { </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">03. overflow: auto; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">04. height: 145px; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">05. </span><span style="font-family:Consolas;font-size:7pt;"> </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">06. } </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">07. table th </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">08. { </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">09.  </span><span style="font-family:Consolas;font-size:7pt;"> </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">10. position: relative; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">11.  </span><span style="font-family:Consolas;font-size:7pt;"> </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">12. }</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="color:#4c4c4c;font-size:12pt;">2. In the above way we have added style to the Panel as a whole.<br />Again we can achieve stable header by adding header style for the grid.<span style="font-family:Times New Roman;"><br /></span>This is the style:<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">1..fixedHeader </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">2. { </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">3. background-color: aqua; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">4. position: relative; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">5. top: expression(this.offsetParent.scrollTop); </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">6. }<br />
</span></p>
<p style="background:#e7e5dc;"><span style="color:#4c4c4c;font-size:12pt;"><span style="font-family:Times New Roman;"><br /></span>And the HTML becomes<span style="font-family:Times New Roman;"> <br />
</span></span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">1.&lt;HeaderStyle CssClass=&#8221;fixedHeader&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">/&gt; </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p> <br />
 </p>
<p><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;"><strong>Conclusion</strong></span><span style="color:#333333;font-family:Verdana;font-size:7pt;"><br /></span><span style="color:#4c4c4c;font-size:12pt;">This article deals with a scrollable gridview that has a stable header.Though this is not possible as such as the gridview doesnot have a scrollable property it can be done by a work around. I hope it helps.Happy Coding.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="color:#4c4c4c;font-size:12pt;">Thank you<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="color:#4c4c4c;font-size:12pt;"><strong>Baimey</strong><span style="font-family:Times New Roman;"><br />
			</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=25&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/a-scrollable-asp-net-gridview-with-a-fixed-header/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>How to use Masked Edit Extender in ASP.NET</title>
		<link>http://baimey.wordpress.com/2010/03/08/how-to-use-masked-edit-extender-in-asp-net/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/how-to-use-masked-edit-extender-in-asp-net/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:24:54 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[AJAX]]></category>
		<category><![CDATA[ASP.Net]]></category>
		<category><![CDATA[Masked Edit extender]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/how-to-use-masked-edit-extender-in-asp-net/</guid>
		<description><![CDATA[  Introduction In this article, I will show you step by step procedure, how to use a Masked Edit ExtenderIn ASP.NET using Visual Studio 2005 or Visual Studio 2008. The use of Masked Edit Extender it that you are not require to type any number of character you have to just select from the up [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=24&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div>
<table style="border-collapse:collapse;" border="0">
<col>
<tbody valign="top">
<tr>
<td vAlign="middle" style="padding-top:12px;border-top:solid #e0c16b 1.5pt;"> </td>
</tr>
</tbody>
</table>
</div>
<p><span style="color:#4f81bd;font-family:Cambria;"><strong><span style="font-size:13pt;">Introduction</span><span style="font-size:12pt;"></p>
<p></span></strong></span><span style="color:#4c4c4c;font-size:12pt;">In this article, I will show you step by step procedure, how to use a Masked Edit Extender<br />In ASP.NET using Visual Studio 2005 or Visual Studio 2008.</p>
<p>The use of Masked Edit Extender it that you are not require to type any number of character you have to just select from the up down button…it will change dynamically when you click the button,</p>
<p>To follow this code sample, you must use Visual Studio 2005 or Visual Studio 2008.</p>
<p>Note : I have used to comment HTML part of the code.</p>
<p>Note: Masked Edit Extender is a part of AjaxControlToolkit.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="font-size:12pt;"><span style="color:#4c4c4c;"><span style="font-family:Times New Roman;"><br /></span>To attach right click on the toolbox under Ajax Extensions and select Choose Items &#8211; &gt; Browse Button &#8211; &gt; select the AjaxControlToolkit.dll. If you are using Visual Studio 2008, you may not need AJAX Toolkit but if you are using Visual Studio 2005, you will need to download it from http://www.msdn.com/ or http://www.asp.net/.</p>
<p>Here is step by step to implement a sample using mask extender.</p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">1.</p>
<p>Start -&gt; All Programs -&gt; Visual Studio 2005 or Visual Studio 2008</p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">2.</p>
<p>Now go to File Menu -&gt; New -&gt; Web Site</p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">3.</p>
<p>Under Visual Studio Installed Template-&gt; Choose ASP.NET WEB SITE -&gt; Choose File System from the location combo box -&gt; Set the path by the browse button &#8211; &gt; Choose the language from the Language ComboBox (Visual C# , Visual Basic , J #) Choose Visual C#.</p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">4.</p>
<p>Click on the OK Button.</p>
<p>This is the source code window and in this page you will se this code.</p>
<p><span style="font-family:Times New Roman;"><br />
				</span></span></span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">Type your webpage title here   </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">&lt;form id=&#8221;"form1?&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">runat=&#8221;"server&#8221;"&gt; </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">&lt;/form&gt;</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="font-size:12pt;"><span style="color:#4c4c4c;"><span style="font-family:Times New Roman;"></p>
<p></span>See here is a tab named Design in the bottom of this page.</p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">5. <span style="font-family:Times New Roman;"><br />
				</span></span></span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;">Click on this tab and you will see a blank web page where you can drag any control from the toolbox (which is in the left side of this window).<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="font-size:12pt;"><span style="color:#4c4c4c;font-family:Times New Roman;"><br /></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">6. <span style="font-family:Times New Roman;"><br />
				</span></span></span></p>
<p><span style="color:#4c4c4c;font-size:12pt;">Now drag controls under the AJAX Extensions.</p>
<p>First control you are going to drag and drop on the page is &#8211; Script Manager.</p>
<p>First register the ajaxtoolkit in the page. Thena dd the code below:<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">Enter the details below in</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">the textboxes and you will see how the masked control </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">Works </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">MaskType=&#8221;Number&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">Mask=&#8221;999&#8243;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">MessageValidatorTip=&#8221;true&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">AcceptNegative=&#8221;None&#8221;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">InputDirection=&#8221;RightToLeft&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">ErrorTooltipEnabled=&#8221;true&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">&gt; </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">ControlToValidate=&#8221;TextBox2&#8243;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">ControlExtender=&#8221;MaskedEditExtender1&#8243;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">MinimumValue=&#8221;1&#8243;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">MaximumValue=&#8221;105&#8243;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">MinimumValueMessage=&#8221;Please enter correct </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">roll number&#8221; MaximumValueMessage=&#8221;Invalid roll number! The highest roll </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">number is</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">105&#8243; Display=&#8221;Dynamic&#8221; IsValidEmpty=&#8221;false&#8221; </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">InvalidValueMessage=&#8221;The roll number does not exist&#8221;</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">EmptyValueMessage=&#8221;The roll number is not entered&#8221;&gt; </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="font-size:12pt;"><span style="color:#4c4c4c;font-family:Times New Roman;"></p>
<p></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">7.</p>
<p>Now run your web site by Ctrl + F5<span style="font-family:Times New Roman;"><br />
				</span></span></span></p>
<p><span style="font-size:12pt;"><span style="color:#4c4c4c;font-family:Times New Roman;"><br /></span><span style="color:#4f81bd;font-family:Cambria;"><strong>Step </strong></span><span style="color:#4c4c4c;">8.</p>
<p>When you run the Masked Edit Extender will seem like this following</p>
<p>Now in the Masked text boxes.you can&#8217;t enter characters or hexadecimal values you can only enter digits and here will be some restrictions. which the masked text box will follow.</p>
<p>Thank<strong><br />
				</strong>you</p>
<p><strong>Baimey</strong><span style="font-family:Times New Roman;"><br />
				</span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/24/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/24/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/24/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=24&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/how-to-use-masked-edit-extender-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>Introduction of the cookies in ASP.NET</title>
		<link>http://baimey.wordpress.com/2010/03/08/introduction-of-the-cookies-in-asp-net/</link>
		<comments>http://baimey.wordpress.com/2010/03/08/introduction-of-the-cookies-in-asp-net/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:17:09 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/08/how-to-use-masked-edit-extender-in-asp-net/</guid>
		<description><![CDATA[Introduction Cookies provide a useful means in Web applications to store user-specific information. For example, when a user visits your site, you can use cookies to store user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier.     There are three [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=21&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;">Introduction</span><span style="color:#4c4c4c;font-family:Verdana;font-size:18pt;"><br />
			</span></strong></p>
<p><span style="color:#4c4c4c;font-size:12pt;">Cookies provide a useful means in Web applications to store user-specific information. For example, when a user visits your site, you can use cookies to store user preferences or other information. When the user visits your Web site another time, the application can retrieve the information it stored earlier.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;">There are three types of classes which allows to work with cookies.</p>
<p>1- <strong>HttpCookie</strong>  : This cookie property allows to create and Manupulate individual Http cookies in asp.net<br />2- <strong>HttpRequest</strong>  : This property allows to access cookies from client machine<br />3- <strong>HttpResponse</strong>  : This property allows to save and create cookie in client machine.<br /></span><span style="color:#333333;font-family:Verdana;font-size:7pt;"></p>
<p></span><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;"><strong>HttpResponse and HttpRequest</strong></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p> <br />
 </p>
<p><strong><span style="font-family:Cambria;font-size:12pt;"><em>How To create cookies in asp.net ? </em></span><span style="color:#4c4c4c;font-family:Verdana;font-size:13pt;"><br />
			</span></strong></p>
<p><span style="color:#4c4c4c;font-size:12pt;"><span style="font-family:Times New Roman;"><br /></span>Response property is used to create cookies.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="color:#4c4c4c;font-size:12pt;">So here is simple cookie using Response.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">1.Response.Cookies(&#8220;Name&#8221;).Value = &#8220;Jason Bourne&#8221;;</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;">This line is saving the cookie where the cookie name is&#8221;Name&#8221; and the value is &#8220;Jason Bourne&#8221; in client machine.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p><strong><span style="font-family:Cambria;font-size:12pt;"><em>How to set the time of expiration of cookie</em></span><span style="color:#4c4c4c;font-family:Verdana;font-size:13pt;"><br />
			</span></strong></p>
<p> <br />
 </p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">1.Response.Cookies(&#8220;Name&#8221;).Expires = DateTime.Now.AddDays(1);</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;">This line is using to set the expire date of this cookie which is 1 day.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p><strong><span style="font-family:Cambria;font-size:12pt;"><em>How to retrieve values from cookies</em></span><span style="color:#4c4c4c;font-family:Verdana;font-size:13pt;"><br />
			</span></strong></p>
<p> <br />
 </p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">1.string</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">name = this.context.Request.Cookies(&#8220;Name&#8221;).Value;</span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;">This line of code is retrieving the value from the cookie and stroing the string variable name and the value of cookie is &#8220;Jason Bourne&#8221; which we were saved before.</p>
<p>If this cookie dosen&#8217;t have any value then the string will return empty. <span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p><strong><span style="color:#4f81bd;font-family:Cambria;font-size:13pt;">HttpCookie</span><span style="color:#4c4c4c;font-family:Verdana;font-size:18pt;"><br />
			</span></strong></p>
<p><span style="color:#4c4c4c;font-size:12pt;">HttpCookie is also a very useful class in creating and retrieving the values from cookies.<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p style="background:#e7e5dc;"><span style="color:#333333;"><span style="font-family:Courier New;font-size:10pt;">1.HttpCookie cook = new</span><span style="font-family:Consolas;font-size:7pt;"><br />
			</span><span style="font-family:Courier New;font-size:10pt;">HttpCookie(&#8220;Name&#8221;); </span></span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">2.cook.Value      = &#8220;Jason Bourne&#8221;; </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">3.cook.Expires    = DateTime.Now.AddDays(1); </span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p style="background:#e7e5dc;"><span style="color:#333333;font-family:Courier New;font-size:10pt;">4.Response.Cookies.Add(cook);</span><span style="color:#4c4c4c;font-family:Times New Roman;font-size:12pt;"><br />
		</span></p>
<p><span style="color:#4c4c4c;font-size:12pt;"><span style="font-family:Times New Roman;"><br /></span>This line is using to set the expire date of this cookie which is 1 day. <span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p><span style="color:#333333;font-family:Verdana;font-size:7pt;"><br /></span><span style="color:#4f81bd;font-family:Cambria;"><strong><span style="font-size:13pt;">Conclusion</span><span style="font-size:12pt;"><br /></span></strong></span><span style="color:#333333;font-family:Verdana;font-size:7pt;"><br /></span><span style="color:#4c4c4c;font-size:12pt;">We have learned how to create cookies, Retrieve the values from Cookies, How to set the expire time of cookies etc.</p>
<p>Thank You<span style="font-family:Times New Roman;"><br />
			</span></span></p>
<p> <br />
 </p>
<p><span style="color:#4c4c4c;font-size:12pt;"><strong>Baimey</strong><span style="font-family:Times New Roman;"><br />
			</span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=21&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/08/introduction-of-the-cookies-in-asp-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>ASP.NET Gridview: Making a GridColumn noneditable in Edit mode</title>
		<link>http://baimey.wordpress.com/2010/03/05/asp-net-gridview-making-a-gridcolumn-noneditable-in-edit-mode/</link>
		<comments>http://baimey.wordpress.com/2010/03/05/asp-net-gridview-making-a-gridcolumn-noneditable-in-edit-mode/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 10:00:54 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/05/asp-net-gridview-making-a-gridcolumn-noneditable-in-edit-mode/</guid>
		<description><![CDATA[Introduction   I came across a very common requirement in my project and thought that will have to find share with all. This article explains how to make a column, say Primary Key, in a gridview noneditable. Create a Website Create a new website File &#62; New &#62; Website    Design (.aspx) Select gridview from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=19&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Introduction<br />
</h1>
<p>
 </p>
<p>I came across a very common requirement in my project and thought that will have to find share with all.
</p>
<p>This<br />
article explains how to make a column, say Primary Key, in a gridview noneditable.
</p>
<h1>Create a Website<br />
</h1>
<div>
<table style="border-collapse:collapse;" border="0">
<col>
<col>
<tbody valign="top">
<tr>
<td colspan="2" vAlign="middle" style="padding-left:7px;padding-right:7px;">
<p style="text-align:center;"><strong>Create a new website File &gt; New &gt; Website<br />
</strong></p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p><img src="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv1.png"></p>
</td>
</tr>
</tbody>
</table>
</div>
<p><img src="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv2.png">
	</p>
<p>
  </p>
<h1>Design (.aspx)<br />
</h1>
<div>
<table style="border-collapse:collapse;" border="0">
<col>
<col>
<tbody valign="top">
<tr>
<td colspan="2" vAlign="middle" style="padding-left:7px;padding-right:7px;">
<p>Select gridview from the toolbox</p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p><img src="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv3.png">
						</p>
</td>
</tr>
<tr>
<td colspan="2" style="padding-left:7px;padding-right:7px;">
<p>Enable edit and add the required bound and template field according to the requirement
</p>
<p>
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><br />
								<span style="color:red;">ID</span><span style="color:blue;">=&#8221;GridView2&#8243;</span><br />
								<span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span><br />
								<span style="color:red;">AutoGenerateColumns</span><span style="color:blue;">=&#8221;False&#8221;</span><br />
								<span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">CommandField</span><br />
								<span style="color:red;">ShowEditButton</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
								<span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
								<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;MyProperty&#8221;</span><br />
								<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Int&#8221;</span><br />
								<span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
								<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;MyProperty1&#8243;</span><br />
								<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;String&#8221;</span><br />
								<span style="color:blue;">/&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;/</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">&lt;/</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">GridView</span><span style="color:blue;">&gt;</span></span></p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p><img src="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv4.png"></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
 </p>
<p>
 </p>
<p>Include three events for the gridview:
</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">OnRowDataBound</span><span style="color:blue;">=&#8221;GridView2_RowDataBound&#8221;<br />
</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">OnRowEditing</span><span style="color:blue;">=&#8221;GridView2_RowEditing&#8221;</span><br />
		</span></p>
<p>
 </p>
<h1>Code Behind (.cs)<br />
</h1>
<h2>Do the databinding from code behind<br />
</h2>
<p>
 </p>
<p>Being a sample here I have bonded a list of objects to the GridView (Can be done according to the requirement).
</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col>
<col>
<tbody valign="top">
<tr>
<td style="padding-left:7px;padding-right:7px;">
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">private</span><br />
								<span style="color:blue;">void</span> DataBindGrid()<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">{<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">Class1</span>&gt; lst = <span style="color:blue;">new</span><br />
								<span style="color:#2b91af;">List</span>&lt;<span style="color:#2b91af;">Class1</span>&gt;();<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
								<span style="color:blue;">for</span> (<span style="color:blue;">int</span> i = 0; i &lt; 10; i++)<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">     {<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">         lst.Add(<span style="color:blue;">new</span><br />
								<span style="color:#2b91af;">Class1</span>()                <span style="color:#00b050;"><br />
								</span></span></p>
<p><span style="font-family:Courier New;font-size:10pt;">         {<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">             MyProperty = i,<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">             MyProperty1 = <span style="color:#a31515;">&#8220;String&#8221;</span> + i<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">         });<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">     }<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">     GridView2.DataSource = lst;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">     GridView2.DataBind();<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"> }<br />
</span></p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p>
 </p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
<p><span style="color:#00b050;font-family:Courier New;font-size:10pt;">//Add the class objects to the list with two properties<br />
</span></p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
<p><span style="color:#00b050;font-family:Courier New;font-size:10pt;">//Binding to gridview</span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
 </p>
<p><span style="color:#4f81bd;font-size:13pt;"><strong>RowBound Event</strong></span><span style="color:blue;font-family:Courier New;font-size:10pt;"><br />
		</span></p>
<p>
 </p>
<p>To make the column 1 readonly on editing add this
</p>
<div>
<table style="border-collapse:collapse;" border="0">
<col>
<col>
<tbody valign="top">
<tr>
<td vAlign="middle" style="padding-left:7px;padding-right:7px;">
<p>Code Behind</p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected</span><br />
								<span style="color:blue;">void</span> GridView2_RowDataBound(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">GridViewRowEventArgs</span> e)</span>
						</p>
<p><span style="font-family:Courier New;font-size:10pt;">{</span>
						</p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:#2b91af;">      BoundField</span> bound = GridView2.Columns[1] <span style="color:blue;">as</span><br />
								<span style="color:#2b91af;">BoundField</span>;</span>
						</p>
<p><span style="font-family:Courier New;font-size:10pt;">      bound.InsertVisible = <span style="color:blue;">false</span>;</span>
						</p>
<p><span style="font-family:Courier New;font-size:10pt;">      bound.ReadOnly = <span style="color:blue;">true</span>;</span>
						</p>
<p> <br />
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"> }</span>
						</p>
</td>
</tr>
<tr>
<td vAlign="middle" style="padding-left:7px;padding-right:7px;">
<p style="text-align:right;"><span style="font-size:14pt;"><strong>OR</strong></span></p>
</td>
<td style="padding-left:7px;padding-right:7px;"> </td>
</tr>
<tr>
<td vAlign="middle" style="padding-left:7px;padding-right:7px;">
<p>ASPX</p>
</td>
<td style="padding-left:7px;padding-right:7px;">
<p>
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span><br />
								<span style="color:red;">DataField</span><span style="color:blue;">=&#8221;MyProperty&#8221;</span><br />
								<span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Int&#8221;</span><br />
								<span style="color:red;">InsertVisible</span><span style="color:blue;">=&#8221;False&#8221;</span><br />
								<span style="color:red;">ReadOnly</span><span style="color:blue;">=&#8221;True&#8221;</span><br />
								<span style="color:blue;">/&gt;</span></span></p>
</td>
</tr>
</tbody>
</table>
</div>
<p>
 </p>
<p>
 </p>
<p><span style="color:#4f81bd;font-size:13pt;"><strong>Editing Event in codebehind<br />
</strong></span></p>
<p>Along with editing we&#8217;ll have to handle<span style="color:#4f81bd;font-size:13pt;"><strong><br />
			</strong></span></p>
<p style="margin-left:36pt;"><span style="font-family:Courier New;font-size:10pt;"><span style="color:red;">onrowcancelingedit</span><span style="color:blue;">=&#8221;GridView2_RowCancelingEdit&#8221;</span><br />
		</span></p>
<p><span style="font-family:Courier New;font-size:10pt;"><br />
			<span style="color:red;">onrowupdating</span><span style="color:blue;">=&#8221;GridView2_RowUpdating&#8221; </span></span>as well.<span style="color:blue;font-family:Courier New;font-size:10pt;"><br />
		</span></p>
<p>But here we&#8217;ll see about the editing event
</p>
<p>
 </p>
<p>
 </p>
<p><span style="font-family:Courier New;font-size:10pt;"><span style="color:blue;">protected</span><br />
			<span style="color:blue;">void</span> GridView2_RowCancelingEdit(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">GridViewCancelEditEventArgs</span> e)<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">    {<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">        GridView2.EditIndex = -1;<br />
</span></p>
<p><span style="font-family:Courier New;font-size:10pt;">        DataBindGrid();<br />
</span></p>
<p>
 </p>
<p>
 </p>
<p><span style="font-family:Courier New;font-size:10pt;">    }<br />
</span></p>
<p>
 </p>
<h1>Conclusion<br />
</h1>
<p>Here we have seen how to make a column noneditab;e in edit mode of a Gridview.
</p>
<p>Happy Coding <span style="font-family:Wingdings;">J</span>
	</p>
<p>
 </p>
<p>Thanks
</p>
<p>Baimey<span style="color:blue;"><br />
		</span></p>
<p>
 </p>
<p>
 </p>
<p>
 </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=19&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/05/asp-net-gridview-making-a-gridcolumn-noneditable-in-edit-mode/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>

		<media:content url="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv1.png" medium="image" />

		<media:content url="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv2.png" medium="image" />

		<media:content url="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv3.png" medium="image" />

		<media:content url="http://baimey.files.wordpress.com/2010/03/030510_1000_aspnetgridv4.png" medium="image" />
	</item>
		<item>
		<title></title>
		<link>http://baimey.wordpress.com/2010/03/05/14/</link>
		<comments>http://baimey.wordpress.com/2010/03/05/14/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 09:59:17 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/2010/03/05/14/</guid>
		<description><![CDATA[<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=14&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=14&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/03/05/14/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
		<item>
		<title>Some silverlight tutorials</title>
		<link>http://baimey.wordpress.com/2010/01/15/some-silverlight-2-tutorials/</link>
		<comments>http://baimey.wordpress.com/2010/01/15/some-silverlight-2-tutorials/#comments</comments>
		<pubDate>Fri, 15 Jan 2010 05:02:47 +0000</pubDate>
		<dc:creator>baimey</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://baimey.wordpress.com/?p=4</guid>
		<description><![CDATA[1. First Look at Silverlight 2 (http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx) In this article, you will have a first look at Silverlight that focuses on enabling Rich Internet Application (RIA) development. 2. The Importance of an Impressive User Interface (http://www.learn-silverlight-tutorial.com/AnimatingSilverlight.cfm#h1.1) In this lesson of the Silverlight tutorial, you will learn about the elements used for drawing graphics and to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=4&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>1. </strong>First Look at Silverlight 2 <strong>(<a href="http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx">http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx</a>)</strong></p>
<p>In this article, you will have a first look at Silverlight that focuses on enabling Rich Internet Application (RIA) development.</p>
<p><strong>2. </strong>The Importance of an Impressive User Interface<strong> (<a href="http://www.learn-silverlight-tutorial.com/AnimatingSilverlight.cfm#h1.1">http://www.learn-silverlight-tutorial.com/AnimatingSilverlight.cfm#h1.1</a>)</strong></p>
<p>In this lesson of the Silverlight tutorial, you will learn about the elements used for drawing graphics and to animate graphics by using Expression Blend.</p>
<p><strong>3.</strong>How to Start with Silverlight<strong> (<a href="http://www.dotnetfunda.com/tutorials/silverlight/">http://www.dotnetfunda.com/tutorials/silverlight/</a>)</strong></p>
<p><strong>4.</strong><a href="http://www.scriptol.com/silverlight/web-project.php" target="_blank">Creating a XAML project for the Web</a><strong> (<a href="http://www.scriptol.com/silverlight/web-project.php">http://www.scriptol.com/silverlight/web-project.php</a>)</strong></p>
<p>They are beginning this tutorial by the creation of a project for a Web application, running in a navigator, and who requires the Silverlight plug-in, plus the SDK for programmers.</p>
<p><strong>5.      </strong><a href="http://www.wynapse.com/Silverlight_Tutorials.aspx" target="_blank">Silverlight Tutorials Collection</a><strong> (<a href="http://www.wynapse.com/Silverlight_Tutorials.aspx">http://www.wynapse.com/Silverlight_Tutorials.aspx</a>)</strong></p>
<p>A good and useful collection of Silverlight tutorials if you want to learn how to get start with it?</p>
<p><strong>6.</strong><a href="http://www.c-sharpcorner.com/UploadFile/mdobbles/SilverlightNavBar07272008212846PM/SilverlightNavBar.aspx" target="_blank">How To Create An Animated Navigation Bar</a><strong> (<a href="http://www.c-sharpcorner.com/UploadFile/mdobbles/SilverlightNavBar07272008212846PM/SilverlightNavBar.aspx">http://www.c-sharpcorner.com/UploadFile/mdobbles/SilverlightNavBar07272008212846PM/SilverlightNavBar.aspx</a>)</strong></p>
<p>This article is a tutorial on how to use Silverlight 2.0 to make a nifty animated navigation bar much like the one at the top of the Silverlight.net website.</p>
<p><strong>7.</strong><a href="http://www.earthware.co.uk/blog/index.php/2009/03/virtual-earth-silverlight-minimap-tutorial/" target="_blank">Virtual Earth Silverlight Minimap Tutorial</a> <strong>(<a href="http://www.earthware.co.uk/blog/index.php/2009/03/virtual-earth-silverlight-minimap-tutorial/">http://www.earthware.co.uk/blog/index.php/2009/03/virtual-earth-silverlight-minimap-tutorial/</a>)</strong></p>
<p>In this tutorial author is going to show you how to create a simple styled minimap to use in your Virtual Earth Silverlight projects that looks exactly like the one we used in our Twittermap demo.</p>
<p><strong>8.</strong><a href="http://designwithsilverlight.com/2009/03/31/silverlight-3-photo-gallery-wall-application/" target="_blank">Silverlight 3 Photo Gallery Wall Application</a> <strong>(<a href="http://designwithsilverlight.com/2009/03/31/silverlight-3-photo-gallery-wall-application/">http://designwithsilverlight.com/2009/03/31/silverlight-3-photo-gallery-wall-application/</a>)</strong></p>
<p>A downloadable source code of Silverlight 3 Photo Gallery Wall Application with useful information to understand how it was done.</p>
<p><strong>9.</strong><a href="http://www.wynapse.com/Silverlight/Tutor/Silverlight_With_Java_Script_Tutorial_07.aspx" target="_blank">Silverlight With Java Script Tutorial</a> <strong>(<a href="http://www.wynapse.com/Silverlight/Tutor/Silverlight_With_Java_Script_Tutorial_07.aspx">http://www.wynapse.com/Silverlight/Tutor/Silverlight_With_Java_Script_Tutorial_07.aspx</a>)</strong></p>
<p>This tutorial will introduce interactive animation. With Interactive Animation, we have the ability to start and stop our animations when we want without having to resort to subterfuge.</p>
<p><strong>10.  </strong><a href="http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx" target="_blank">Creating Rich Data Forms in Silverlight 3 &#8211; Introduction</a> <strong>(<a href="http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx">http://www.silverlightshow.net/items/Creating-Rich-Data-Forms-in-Silverlight-3-Introduction.aspx</a>)</strong></p>
<p>In this article author will show you the basics of the DataForm control – what you can do with it and why you should use it. He will show you how you can bind an item or a collection of items to a data form. Microsoft guys have done a great job with this control, so there are many features that you can use directly without much pain.</p>
<p><strong>11.  </strong><a href="http://smehrozalam.wordpress.com/2009/01/07/securing-silverlight-application-and-wcf-service-using-aspnet-authentication-techniques/" target="_blank">Securing Silverlight Application and WCF Service using ASP.Net Authentication Techniques</a> <strong>(<a href="http://smehrozalam.wordpress.com/2009/01/07/securing-silverlight-application-and-wcf-service-using-aspnet-authentication-techniques/">http://smehrozalam.wordpress.com/2009/01/07/securing-silverlight-application-and-wcf-service-using-aspnet-authentication-techniques/</a>)</strong></p>
<p>In this article you can learn the securing Silverlight Application and WCF Service using ASP.Net Authentication Techniques.</p>
<p><strong>12.  </strong><a href="http://www.silverlightshow.net/items/Animation-Easing-in-Silverlight-3.aspx" target="_blank">Animation Easings in Silverlight 3</a><strong> (<a href="http://www.silverlightshow.net/items/Animation-Easing-in-Silverlight-3.aspx">http://www.silverlightshow.net/items/Animation-Easing-in-Silverlight-3.aspx</a>)</strong></p>
<p>In this author will describe in details how you can use the BackEase animation.</p>
<p><strong>13.  </strong><a href="http://www.silverlightshow.net/items/The-Silverlight-BlockText-Control.aspx" target="_blank">The Silverlight BlockText Control</a> <strong>(<a href="http://www.silverlightshow.net/items/The-Silverlight-BlockText-Control.aspx">http://www.silverlightshow.net/items/The-Silverlight-BlockText-Control.aspx</a>)</strong></p>
<p>The main idea is to let Silverlight’s Grid do the work. So at the beginning Author split the given string into words and draw them hidden into temporary grid, so he get the ActualWidth of each word.</p>
<p><strong>14.  </strong><a href="http://aspalliance.com/1824_Introduction_to_XAML_Browser_Applications_XBAP.1" target="_blank">Introduction to XAML Browser Applications</a> <strong>(<a href="http://aspalliance.com/1824_Introduction_to_XAML_Browser_Applications_XBAP.1">http://aspalliance.com/1824_Introduction_to_XAML_Browser_Applications_XBAP.1</a>)</strong></p>
<p>This article gives an introduction to XBAPs and provides information about the differences between WPF Standalone applications, Silverlight, and XBAPs. Nihar explains the steps used to create a sample XBAP application and how to deploy and run it.</p>
<p><strong>15.  </strong><a href="http://flashenabledblog.com/2007/07/09/from-a-to-z-50-silverlight-applications/" target="_blank">50 Silverlight Applications</a><strong> (<a href="http://flashenabledblog.com/2007/07/09/from-a-to-z-50-silverlight-applications/">http://flashenabledblog.com/2007/07/09/from-a-to-z-50-silverlight-applications/</a>)</strong></p>
<p>This is the collection of 50 sample applications developed in Silverlight.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/baimey.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/baimey.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/baimey.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=baimey.wordpress.com&amp;blog=10635514&amp;post=4&amp;subd=baimey&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://baimey.wordpress.com/2010/01/15/some-silverlight-2-tutorials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2651d33936ed82bb5508305cca8e627d?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">baimey</media:title>
		</media:content>
	</item>
	</channel>
</rss>
