Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
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
v3
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

C# is a server side scripting you can use javascript function like confirm in the OnclientClick event of the button
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

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  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 6

  Permalink  

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

  Print Answers RSS
0 Richard MacCutchan 335
1 OriginalGriff 310
2 Sergey Alexandrovich Kryukov 207
3 Sharmanuj 146
4 Magic Wonder 129
0 Sergey Alexandrovich Kryukov 5,999
1 OriginalGriff 5,115
2 CPallini 2,473
3 Richard MacCutchan 1,597
4 Abhinav S 1,505


Advertise | Privacy | Mobile
Web04 | 2.8.140814.1 | Last Updated 10 Jan 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100