Click here to Skip to main content
15,868,292 members
Please Sign up or sign in to vote.
2.60/5 (2 votes)
See more:
when i delete data from gridview using delete option ,it will ask for confirmation.So i have to use dialogbox.how i can do it ?

i have autogeneratedelete button in grideview .So if javascript is used then how to use javasript please explain sortlly.
Posted
Updated 9-Jan-13 6:56am
v3

You can use confirm javascript on button click event.
ASP.NET
<asp:button id="btnDelete" text="Delete" onclientclick=" return confirm('Are you want to Delete this Record?');" xmlns:asp="#unknown">
</asp:button>
 
Share this answer
 
Alert msg with redirect!

XML
Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Please Check your mail for further details');window.location.href='Default.aspx';</script>");

Alert msg !

 Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script>alert('Please Check your mail for further details')</script>");
 
Share this answer
 
C# is a server side scripting you can use javascript function like confirm in the OnclientClick event of the button
 
Share this answer
 
Good Question!!!!
you can not use java script in C# scripting but you can put this in design file(Default.aspx). And do your Server side scripting in(Default.aspx.cs)
 
Share this answer
 
 
Share this answer
 
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900