<?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>My ASP knowledge base</title>
	<atom:link href="http://aspknowledgebase.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://aspknowledgebase.wordpress.com</link>
	<description></description>
	<lastBuildDate>Thu, 24 Feb 2011 12:28:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='aspknowledgebase.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>My ASP knowledge base</title>
		<link>http://aspknowledgebase.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://aspknowledgebase.wordpress.com/osd.xml" title="My ASP knowledge base" />
	<atom:link rel='hub' href='http://aspknowledgebase.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Source code custom server control</title>
		<link>http://aspknowledgebase.wordpress.com/2007/07/06/source-code-custom-server-control/</link>
		<comments>http://aspknowledgebase.wordpress.com/2007/07/06/source-code-custom-server-control/#comments</comments>
		<pubDate>Fri, 06 Jul 2007 09:18:25 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[asp]]></category>
		<category><![CDATA[compositecontrol]]></category>
		<category><![CDATA[custom control]]></category>
		<category><![CDATA[custom server control]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[GridView]]></category>
		<category><![CDATA[smart tags]]></category>

		<guid isPermaLink="false">http://aspknowledgebase.wordpress.com/2007/07/06/source-code-custom-server-control/</guid>
		<description><![CDATA[The article about the custom grid control is finished. The post contains links to multiple page explaining the control and the source code has been added (with an example how to use the control). Regards, Jan<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=33&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The article about the custom grid control is finished. The post contains links to multiple page explaining the control and the source code has been added (with an example how to use the control).</p>
<p>Regards, Jan</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/aspknowledgebase.wordpress.com/33/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/aspknowledgebase.wordpress.com/33/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aspknowledgebase.wordpress.com/33/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aspknowledgebase.wordpress.com/33/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aspknowledgebase.wordpress.com/33/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=33&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aspknowledgebase.wordpress.com/2007/07/06/source-code-custom-server-control/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2704dc16d1ea5d81be83b5a1a76f0e40?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jan</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Server Control: build your own simple GridView</title>
		<link>http://aspknowledgebase.wordpress.com/2007/06/29/custom-server-control-build-your-own-simple-gridview/</link>
		<comments>http://aspknowledgebase.wordpress.com/2007/06/29/custom-server-control-build-your-own-simple-gridview/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 09:23:02 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[asp]]></category>
		<category><![CDATA[compositecontrol]]></category>
		<category><![CDATA[custom control]]></category>
		<category><![CDATA[custom server control]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[GridView]]></category>
		<category><![CDATA[smart tags]]></category>

		<guid isPermaLink="false">http://aspknowledgebase.wordpress.com/2007/06/29/custom-server-control-build-your-own-simple-gridview/</guid>
		<description><![CDATA[&#8220;This article consists of several pages describing the definition of a custom grid control. You can create your own controls in two ways: User Controls (ascx-extention): a small part of a page that will be reused in your web pages. Custom Server Controls: classes that will generate HTML. Custom Server Controls are compiled into DLL [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=16&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>&#8220;This article consists of several pages describing the definition of a custom grid control. You can create your own controls in two ways:</p>
<ul>
<li>User Controls (ascx-extention): a small part of a page that will be reused in your web pages.
<li>Custom Server Controls: classes that will generate HTML. Custom Server Controls are compiled into DLL assemblies. </li>
</ul>
<p>This example describes a Custom Server Control. This gives you total control over the HTML and makes it possible to add the control to your toolbox.</p>
<blockquote>
<p><font face="Arial" color="#989898" size="1"><strong>If you are interested in User Controls, see the following pages for more information:</strong><br /></font><a href="http://www.15seconds.com/issue/020319.htm"><font face="Arial" color="#989898" size="1"><u>http://www.15seconds.com/issue/020319.htm</u></font></a><br /><a href="http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/userctrl/default.aspx"><font face="Arial" color="#989898" size="1"><u>http://quickstarts.asp.net/QuickStartv20/aspnet/doc/ctrlref/userctrl/default.aspx</u></font></a></p>
</blockquote>
<p>The custom server control described in this article, is a simple databound grid. Easy to add to your web pages, for those cases where you do not need the extended features of the VS2005’s GridView. And you can modify this control to you own wishes.</p>
<blockquote>
<p><font face="Arial" color="#989898" size="1"><strong>This custom grid control is not a templated control. If you are interested in templated custom server controls, please see </strong></font><a href="http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx" target="_blank"><font face="Arial" color="#989898" size="1"><u>http://samples.gotdotnet.com/quickstart/aspplus/doc/webctrlauthoring.aspx</u></font></a><font face="Arial" color="#989898" size="1"><strong> for more information.</strong></font></p>
</blockquote>
<p><font face="Arial" color="#989898" size="1"></font>The custom grid control looks like this:</p>
<p><img alt="Custom Grid Control" src="http://aspknowledgebase.files.wordpress.com/2007/06/customgridcontrol.png"></p>
<p>You can add the control by adding a reference in your web page and define the grid&#8217;s parameters:</p>
<p class="MsoNormal"><span style="font-size:8pt;background:yellow;font-family:'Courier New';">&lt;%</span><span style="font-size:8pt;color:blue;font-family:'Courier New';">@</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:#a31515;">Register</span> <span style="color:red;">Assembly</span><span style="color:blue;">=&#8221;WITControlsLibrary&#8221;</span> <span style="color:red;">Namespace</span><span style="color:blue;">=&#8221;WITControlsLibrary&#8221;</span> <span style="color:red;">TagPrefix</span><span style="color:blue;">=&#8221;wit&#8221;</span> <span style="background:yellow;">%&gt;<br /></span></span><span style="font-size:8pt;"><br /></span><span style="font-size:8pt;color:blue;font-family:'Courier New';">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:'Courier New';">wit</span><span style="font-size:8pt;color:blue;font-family:'Courier New';">:</span><span style="font-size:8pt;color:#a31515;font-family:'Courier New';">WITGrid</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;WITGridExample&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">DataSourceID</span><span style="color:blue;">=&#8221;AccessDataSource1&#8243;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">DataKeyName</span><span style="color:blue;">=&#8221;participantID&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">ShowDeleteColumn</span><span style="color:blue;">=&#8221;True&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">ShowEditColumn</span><span style="color:blue;">=&#8221;True&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">ShowOrderColumn</span><span style="color:blue;">=&#8221;True&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">HighLightSelectedRow</span><span style="color:blue;">=&#8221;true&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">HighLightCssClass</span><span style="color:blue;">=&#8221;GridView-Highlight&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">EmptyGridCssClass</span><span style="color:blue;">=&#8221;GridView-Empty&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">NoRecordsText</span><span style="color:blue;">=&#8221;No records where found.&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">EnableViewState</span><span style="color:blue;">=&#8221;False&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">OnRowDataBound</span><span style="color:blue;">=&#8221;gridExample_OnRowDataBound&#8221;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">OnRowCommand</span><span style="color:blue;">=&#8221;gridExample_OnRowCommand&#8221;&gt;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">wit</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-max&#8221;</span> <span style="color:red;">DataField</span><span style="color:blue;">=&#8221;participantName&#8221;</span> <span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Name&#8221;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">wit</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-medium&#8221;</span> <span style="color:red;">DataField</span><span style="color:blue;">=&#8221;participantEMail&#8221;</span> <span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;E-mail&#8221;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">wit</span><span style="color:blue;">:</span><span style="color:#a31515;">CheckBoxField</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-medium&#8221;</span> <span style="color:red;">DataField</span><span style="color:blue;">=&#8221;participantLocked&#8221;</span> <span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Locked&#8221;</span> <span style="color:blue;">/&gt;<br />&lt;/</span><span style="color:#a31515;">wit</span><span style="color:blue;">:</span><span style="color:#a31515;">WITGrid</span><span style="color:blue;">&gt;</span></span><span style="font-size:8pt;"></p>
<p></span></p>
<p></span></p>
<p>The article is split up into different pages in order to avoid one very lengthy page. Click on one of the following items for more info, or click <a href="http://aspknowledgebase.wordpress.com/15/starting-the-project/">Next Page &gt;&gt;</a>&nbsp; </p>
<p>I hope these articles will help you further in building your own grid. </p>
<p>Regards, Jan </p>
<div style="border-right:#c0c0c0 1px solid;border-top:#c0c0c0 1px solid;border-left:#c0c0c0 1px solid;border-bottom:#c0c0c0 1px solid;background-color:#ffffe0;">
<ol>
<li><a href="http://aspknowledgebase.wordpress.com/15/starting-the-project/">Getting started: adding the right resources, references and assembly information.</a>
<li><a href="http://aspknowledgebase.wordpress.com/15/designing-the-inner-elements/">Designing the ‘inner’ elements of the grid (the data columns: BoundField.cs, CheckBoxField.cs, etc.).</a>
<li><a href="http://aspknowledgebase.wordpress.com/15/the-grid-class-itself/">The grid control itself (WITGrid.cs).</a>
<li><a href="http://aspknowledgebase.wordpress.com/15/the-grids-event-arguments/">The grid&#8217;s event arguments.</a>
<li><a href="http://aspknowledgebase.wordpress.com/15/the-grids-designer-class/">The designer class (WITGridDesigner) that enables the grid to be shown in web page’s design view.</a>
<li><a href="http://aspknowledgebase.wordpress.com/15/addign-smart-tags/">Adding smart tags: the designer action list class.</a>
<li>Add the control to your web page: <a href="http://aspknowledgebase.wordpress.com/15/custom-grid-add-to-your-web-page/">The grid&#8217;s parameters and events explained.</a>
<li><font color="#ff0000"><font color="#000000"><a href="http://aspknowledgebase.wordpress.com/15/custom-grid-control-source-code/">The source code of the control and an example</a></font><br /></font></li>
</ol>
</div>
<table cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td style="text-align:left;">&nbsp;</td>
<td style="text-align:right;"><a href="http://aspknowledgebase.wordpress.com/15/starting-the-project/"><u>Next Page &gt;&gt;</u></a></td>
</tr>
</tbody>
</table>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/aspknowledgebase.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/aspknowledgebase.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aspknowledgebase.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aspknowledgebase.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aspknowledgebase.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=16&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aspknowledgebase.wordpress.com/2007/06/29/custom-server-control-build-your-own-simple-gridview/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2704dc16d1ea5d81be83b5a1a76f0e40?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jan</media:title>
		</media:content>

		<media:content url="http://aspknowledgebase.files.wordpress.com/2007/06/customgridcontrol.png" medium="image">
			<media:title type="html">Custom Grid Control</media:title>
		</media:content>
	</item>
		<item>
		<title>Custom Control: how to add a toolbar image</title>
		<link>http://aspknowledgebase.wordpress.com/2007/06/23/custom-control-how-to-add-a-toolbar-image/</link>
		<comments>http://aspknowledgebase.wordpress.com/2007/06/23/custom-control-how-to-add-a-toolbar-image/#comments</comments>
		<pubDate>Sat, 23 Jun 2007 12:27:23 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[asp]]></category>
		<category><![CDATA[custom control]]></category>

		<guid isPermaLink="false">http://aspknowledgebase.wordpress.com/2007/06/23/custom-control-how-to-add-a-toolbar-image/</guid>
		<description><![CDATA[In case you want to have a custom image for your control in the Visual Studio toolbox, you can do this by adding the following directive to your user control: namespace CustomControlsLibrary { [System.Drawing.ToolboxBitmap(@"c:\CustomControl\Resources\toolbox.bmp")] public class CustomControl : Control, INamingContainer { &#8230;.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=8&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In case you want to have a custom image for your control in the Visual Studio toolbox, you can do this by adding the following directive to your user control:</p>
<p><font face="Arial" size="1">namespace CustomControlsLibrary<br />
{<br />
<strong><font color="#0000ff">[System.Drawing.ToolboxBitmap(@"c:\CustomControl\Resources\toolbox.bmp")]</font></strong><br />
public class CustomControl : Control,  INamingContainer<br />
{ &#8230;.<br />
</font></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/aspknowledgebase.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/aspknowledgebase.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aspknowledgebase.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aspknowledgebase.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aspknowledgebase.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=8&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aspknowledgebase.wordpress.com/2007/06/23/custom-control-how-to-add-a-toolbar-image/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2704dc16d1ea5d81be83b5a1a76f0e40?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jan</media:title>
		</media:content>
	</item>
		<item>
		<title>GridView: how to add a confirmation box to delete button</title>
		<link>http://aspknowledgebase.wordpress.com/2007/06/22/add-confirmation-window-to-delete-button-in-gridview/</link>
		<comments>http://aspknowledgebase.wordpress.com/2007/06/22/add-confirmation-window-to-delete-button-in-gridview/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 22:08:20 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[asp]]></category>
		<category><![CDATA[confirmation]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[GridView]]></category>

		<guid isPermaLink="false">http://aspknowledgebase.wordpress.com/2007/06/22/add-confirmation-window-to-delete-button-in-gridview/</guid>
		<description><![CDATA[In case&#160;you use delete buttons in a GridView (like below) it would be nice to ask the user for confirmation (message box). There are two ways to achieve this: By using the ConfirmButtonExtender in Ajax. By adding a confirmation box to each row when the grid rows are bound. The first options is the easiest [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=7&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In case&nbsp;you use delete buttons in a GridView (like below) it would be nice to ask the user for confirmation (message box).</p>
<p><a href="http://aspknowledgebase.files.wordpress.com/2007/06/gridview.png"><img style="border-width:0;" height="217" alt="gridview" src="http://aspknowledgebase.files.wordpress.com/2007/06/gridview-thumb.png?w=440&#038;h=217" width="440" border="0"></a></p>
<p>There are two ways to achieve this:</p>
<ol>
<li>By using the ConfirmButtonExtender in Ajax.
<li>By adding a confirmation box to each row when the grid rows are bound. </li>
</ol>
<p>The first options is the easiest to implement (only design, no code-behind). The second the most flexible: you can add information about the record in your question.</p>
<p><strong>1. By using the ConfirmButtoExtender in Ajax</strong></p>
<ul>
<li>Be sure&nbsp;Ajax is available (see <a href="http://ajax.asp.net" target="_blank">ajax.asp.net</a>).
<li>Add a reference to the toolkit in you web page </li>
</ul>
<p class="MsoNormal" style="line-height:normal;"><span style="font-size:8pt;background:yellow;font-family:'Courier New';">&lt;%</span><span style="font-size:8pt;color:blue;font-family:'Courier New';">@</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:#a31515;">Register</span> <span style="color:red;">Assembly</span><span style="color:blue;">=&#8221;AjaxControlToolkit&#8221;</span> <span style="color:red;">Namespace</span><span style="color:blue;">=&#8221;AjaxControlToolkit&#8221;<br />&nbsp;&nbsp;&nbsp; </span><span style="color:red;">TagPrefix</span><span style="color:blue;">=&#8221;ajaxToolkit&#8221;</span> <span style="background:yellow;">%&gt;</span></span></p>
<ul>
<li>In the GridView, use a template field for the delete column containing the (image button) for the delete command.
<li>Add the ConfirmButtonExtender to the ItemTemplate of the delete column and link the TargetControlID to the delete button.<br />The source for the delete column should look something like this (the&nbsp;squared area is the part where the delete button is defined, the rest is the complete GridView-definition): </li>
</ul>
<p class="MsoNormal" style="line-height:normal;"><span style="font-size:8pt;color:blue;font-family:'Courier New';">&lt;</span><span style="font-size:8pt;color:#a31515;font-family:'Courier New';">asp</span><span style="font-size:8pt;color:blue;font-family:'Courier New';">:</span><span style="font-size:8pt;color:#a31515;font-family:'Courier New';">GridView</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;gridOverview&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">AutoGenerateColumns</span><span style="color:blue;">=&#8221;False&#8221;<br /><span>&nbsp;&nbsp;&nbsp; </span></span><span style="color:red;">AllowSorting</span><span style="color:blue;">=&#8221;false&#8221; <br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:red;">DataKeyNames</span><span style="color:blue;">=&#8221;selectcolId&#8221;</span> <span style="color:red;">DataSourceID</span><span style="color:blue;">=&#8221;odcColumns&#8221; </span><span style="color:red;">AllowPaging</span><span style="color:blue;">=&#8221;false&#8221;<br /><span>&nbsp;&nbsp; </span></span><span>&nbsp;</span><span style="color:red;">OnRowCommand</span><span style="color:blue;">=&#8221;gridOverview_OnRowCommand&#8221;<br /><span>&nbsp;&nbsp;&nbsp; </span></span><span style="color:red;">OnRowDataBound</span><span style="color:blue;">=&#8221;gridOverview_OnRowDataBound&#8221;&gt;<br /></span><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">BoundField</span> <span style="color:red;">DataField</span><span style="color:blue;">=&#8221;bookTitle&#8221;</span> <span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Title&#8221;</span> <span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:#a31515;">ItemStyle</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-small&#8221;</span> <span style="color:blue;">/&gt;</span></span></p>
<p class="MsoNormal" style="line-height:normal;"><span style="font-size:8pt;font-family:'Courier New';"></span></p>
<div style="border-right:windowtext 1pt solid;border-top:windowtext 1pt solid;border-left:windowtext 1pt solid;border-bottom:windowtext 1pt solid;padding:1pt 4pt;">
<p class="MsoNormal" style="border-right:medium none;border-top:medium none;border-left:medium none;line-height:normal;border-bottom:medium none;padding:0;"><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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:red;">HeaderText</span><span style="color:blue;">=&#8221;Delete&#8221;</span> <span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemStyle</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-buttons&#8221;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">ImageButton</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;ibDelete&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">CausesValidation</span><span style="color:blue;">=&#8221;False&#8221;</span> <span style="color:red;">CommandName</span><span style="color:blue;">=&#8221;Delete&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span>&nbsp;</span><span style="color:red;">ImageUrl</span><span style="color:blue;">=&#8221;~/Images/icon-delete.gif&#8221;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ajaxToolkit</span><span style="color:blue;">:</span><span style="color:#a31515;">ConfirmButtonExtender</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;ConfirmBtExt1&#8243;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <span style="color:red;">TargetControlID</span><span style="color:blue;">=&#8221;ibDelete&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">ConfirmText</span><span style="color:blue;">=&#8217;Are you sure about deleting this record?&#8217;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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></p>
</div>
<p class="MsoNormal" style="line-height:normal;"><span style="font-size:8pt;color:blue;font-family:'Courier New';">&nbsp;<br />&nbsp;</span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">CommandField</span> <span style="color:red;">ButtonType</span><span style="color:blue;">=&#8221;Image&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">SelectImageUrl</span><span style="color:blue;">=&#8221;~/Images/icon-pencil.gif&#8221;</span> <span style="color:red;">HeaderText</span><span style="color:blue;">=&#8221;Edit&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span>&nbsp;</span><span style="color:red;">ShowHeader</span><span style="color:blue;">=&#8221;True&#8221;</span> <span style="color:red;">ShowSelectButton</span><span style="color:blue;">=&#8221;True&#8221;</span> <span style="color:red;">CausesValidation</span><span style="color:blue;">=&#8221;False&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="color:red;">sItemStyle-CssClass</span><span style="color:blue;">=&#8221;grid-column-buttons&#8221;</span> <span style="color:blue;">/&gt;</p>
<p></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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:red;">HeaderText</span><span style="color:blue;">=&#8221;Order&#8221;&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">ImageButton</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;ibColDown&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">CommandName</span><span style="color:blue;">=&#8221;ColDown&#8221;</span> <span style="color:red;">ImageUrl</span><span style="color:blue;">=&#8221;~/Images/down.gif&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span>&nbsp;</span><span style="color:red;">CommandArgument</span><span style="color:blue;">=&#8221;</span><span style="background:yellow;">&lt;%</span># Container.DataItemIndex <span style="background:yellow;">%&gt;</span><span style="color:blue;">&#8220;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">ImageButton</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;ibColUp&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">CommandName</span><span style="color:blue;">=&#8221;ColUp&#8221;</span> <span style="color:red;">ImageUrl</span><span style="color:blue;">=&#8221;~/Images/up.gif&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span style="color:red;">CommandArgument</span><span style="color:blue;">=&#8221;</span><span style="background:yellow;">&lt;%</span># Container.DataItemIndex <span style="background:yellow;">%&gt;</span><span style="color:blue;">&#8220;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemStyle</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-buttons&#8221;</span> <span style="color:blue;">/&gt;<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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>&nbsp;&nbsp;&nbsp;&nbsp; </span><br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">Columns</span><span style="color:blue;">&gt;<br />&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>
<p>For more information, see <a href="http://ajax.asp.net/ajaxtoolkit/ConfirmButton/ConfirmButton.aspx" target="_blank">ConfirmButton</a></p>
<p><strong>2. By adding a confirmation box to each row when the rows are bound</strong></p>
<ul>
<li>Add a reference to an event handler in the GridView (see also the example above): </li>
</ul>
<p class="MsoNormal"><span style="font-size:8pt;color:red;font-family:'Courier New';">OnRowDataBound</span><span style="font-size:8pt;color:blue;font-family:'Courier New';">=&#8221;gridOverview_OnRowDataBound&#8221;</span><span style="font-size:8pt;"></span></p>
<ul>
<li>
<p align="left">The delete column (ItemTemplate) should be an (image) button in a template field (replace the&nbsp;squared area in the example above with this code):</p>
</li>
</ul>
<p class="MsoNormal" style="line-height:normal;"><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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:red;">HeaderText</span><span style="color:blue;">=&#8221;Delete&#8221;</span> <span style="color:blue;">&gt;<br /></span></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemStyle</span> <span style="color:red;">CssClass</span><span style="color:blue;">=&#8221;grid-column-buttons&#8221;</span> <span style="color:blue;">/&gt;<br /></span></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;</span><span style="color:#a31515;">asp</span><span style="color:blue;">:</span><span style="color:#a31515;">ImageButton</span> <span style="color:red;">ID</span><span style="color:blue;">=&#8221;ibDelete&#8221;</span> <span style="color:red;">runat</span><span style="color:blue;">=&#8221;server&#8221;</span> <br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:red;">CausesValidation</span><span style="color:blue;">=&#8221;False&#8221;</span> <span style="color:red;">CommandName</span><span style="color:blue;">=&#8221;Delete&#8221;<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span></span><span>&nbsp;</span><span style="color:red;">ImageUrl</span><span style="color:blue;">=&#8221;~/Images/icon-delete.gif&#8221;</span> <span style="color:blue;">/&gt;<br /></span></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">&lt;/</span><span style="color:#a31515;">ItemTemplate</span><span style="color:blue;">&gt;<br /></span></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><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></p>
<ul>
<li>
<p align="left">Create the event handler &#8216;gridOverview_OnRowDataBound&#8217; in the code behind. When each row is bound, this procedure will add a message box to the image button.</p>
</li>
</ul>
<p class="MsoNormal"><span style="font-size:8pt;color:blue;font-family:'Courier New';">protected</span><span style="font-size:8pt;font-family:'Courier New';"> <span style="color:blue;">void</span> gridOverview_OnRowDataBound(<span style="color:blue;">object</span> sender, <span style="color:#2b91af;">GridViewRowEventArgs</span> e)<br /><span style="color:green;">//Add delete msgbox to each row containing field </span><br /><span style="color:green;">//information to identify the row<br /></span>{<br /><span>&nbsp;&nbsp;&nbsp; </span><span style="color:blue;">if</span> (e.Row.RowType == <span style="color:#2b91af;">DataControlRowType</span>.DataRow)<br /><span>&nbsp;&nbsp;&nbsp; </span>{<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:green;">// reference the Delete ImageButton<br /></span><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:#2b91af;">ImageButton</span> ib = (<span style="color:#2b91af;">ImageButton</span>)e.Row.FindControl(<span style="color:#a31515;">&#8220;ibDelete&#8221;</span>);<br /><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>ib.Attributes.Add(<span style="color:#a31515;">&#8220;onclick&#8221;</span>,<span style="color:#a31515;">&#8220;javascript:return &#8221; +</span></span></p>
<p class="MsoNormal"><span style="font-size:8pt;color:#a31515;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>confirm(&#8216;Are you sure about deleting &#8221; +<br /></span><span style="font-size:8pt;font-family:'Courier New';"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span><span style="color:#2b91af;">DataBinder</span>.Eval(e.Row.DataItem, <span style="color:#a31515;">&#8220;bookTitle&#8221;</span>) +<span style="color:#a31515;"> &#8220;?&#8217;);&#8221;</span>);<br /><span>&nbsp;&nbsp;&nbsp; </span>}<br />}<br /></span><span style="font-size:8pt;"></p>
<p></span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/aspknowledgebase.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/aspknowledgebase.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aspknowledgebase.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aspknowledgebase.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aspknowledgebase.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=7&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aspknowledgebase.wordpress.com/2007/06/22/add-confirmation-window-to-delete-button-in-gridview/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2704dc16d1ea5d81be83b5a1a76f0e40?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jan</media:title>
		</media:content>

		<media:content url="http://aspknowledgebase.files.wordpress.com/2007/06/gridview-thumb.png" medium="image">
			<media:title type="html">gridview</media:title>
		</media:content>
	</item>
		<item>
		<title>First blog</title>
		<link>http://aspknowledgebase.wordpress.com/2007/06/22/first-blog/</link>
		<comments>http://aspknowledgebase.wordpress.com/2007/06/22/first-blog/#comments</comments>
		<pubDate>Fri, 22 Jun 2007 21:05:01 +0000</pubDate>
		<dc:creator>Jan</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://aspknowledgebase.wordpress.com/2007/06/22/first-blog/</guid>
		<description><![CDATA[I cannot count the hours I have spend searching for solutions to my ASP.NET problems. Too many. And as developing is not my daily work, I sometimes forget the how-to&#8217;s. That&#8217;s why I started this blog: too gather this info in one place so that I do not have to look for it again. And [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=4&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I cannot count the hours I have spend searching for solutions to my ASP.NET problems. Too many. And as developing is not my daily work, I sometimes forget the how-to&#8217;s.<br />
That&#8217;s why I started this blog: too gather this info in one place so that I do not have to look for it again. And maybe it wil help others too. Leave a comment if it is of any help.<br />
PS: All the code is in C#</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/aspknowledgebase.wordpress.com/4/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/aspknowledgebase.wordpress.com/4/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/aspknowledgebase.wordpress.com/4/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/aspknowledgebase.wordpress.com/4/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/aspknowledgebase.wordpress.com/4/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=aspknowledgebase.wordpress.com&amp;blog=1273383&amp;post=4&amp;subd=aspknowledgebase&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://aspknowledgebase.wordpress.com/2007/06/22/first-blog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/2704dc16d1ea5d81be83b5a1a76f0e40?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Jan</media:title>
		</media:content>
	</item>
	</channel>
</rss>
