Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NET
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 8-Jan-13 19:23pm
Edited 9-Jan-13 6:56am


5 solutions

You can use confirm javascript on button click event.
<asp:button id="btnDelete" text="Delete" onclientclick=" return confirm('Are you want to Delete this Record?');" xmlns:asp="#unknown">
</asp:button>
  Permalink  
Alert msg with redirect!
 
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>");
  Permalink  
C# is a server side scripting you can use javascript function like confirm in the OnclientClick event of the button
  Permalink  
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)
  Permalink  

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Christian Graus 477
1 Ron Beyer 316
2 samadhan_kshirsagar 269
3 Tadit Dash 243
4 OriginalGriff 181
0 Sergey Alexandrovich Kryukov 7,061
1 Prasad_Kulkarni 3,815
2 OriginalGriff 3,557
3 _Amy 3,370
4 CPallini 3,034


Advertise | Privacy | Mobile
Web01 | 2.6.130619.1 | Last Updated 10 Jan 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid