Re: gridview javascript confirmation popup

"Potter, Mark" <[email protected]> Mon, 20 Aug 2007 10:49:16 -0400
Newsgroups gmane.comp.windows.devel.dotnet.web
Message-ID <[email protected]>
<asp:TemplateField HeaderText="Select">

<ItemTemplate>

<asp:LinkButton ID="LinkButton1" CommandArgument='<%# Eval("CategoryID")
%>' CommandName="Delete" runat="server">Delete</asp:LinkButton>

</ItemTemplate>

</asp:TemplateField>


protected void GridView1_RowDataBound(object sender,
GridViewRowEventArgs e)
{

if (e.Row.RowType == DataControlRowType.DataRow)

{

LinkButton l = (LinkButton)e.Row.FindControl("LinkButton1"); 

l.Attributes.Add("onclick", "javascript:return " +

"confirm('Are you sure you want to delete this record " +

DataBinder.Eval(e.Row.DataItem, "CategoryID") + "')"); 

}

}

http://www.gridviewguy.com/ArticleDetails.aspx?articleID=138


-----Original Message-----
From: Discussion of building .NET applications targeted for the Web
[mailto:[email protected]] On Behalf Of Smotritsky, Alex
Sent: Monday, August 20, 2007 10:37 AM
To: [email protected]
Subject: [DOTNET-WEB] gridview javascript confirmation popup

In a gridview I'd like to pop up a javascript confirmation dialog to
allow the user to confirm that they want a server side action taken
after they click on a control in the gridview like a button or
linkbutton. Anyone know how to do this?

 

 


===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com