trigger confirm box

i have used ShowHeader=”true” HeaderText=”Edit” HeaderStyle-Font-Bold=”true” /> in my gridview.Response.Write(“confirm(‘Are you sure’);“);if(“OK”) else how to take the value if ok is cliked or noti need to show the confirm box when this edit is cliked,using c# and not java script. how to trigger that confirm box …

via C Programming Language Tutorial » Search Results » ajax:

trigger confirm box

i have used
ShowHeader=”true” HeaderText=”Edit”
HeaderStyle-Font-Bold=”true” /> in my gridview.
Response.Write(““);
if(“OK”)

else

how to take the value if ok is cliked or not
i need to show the confirm box when this edit is cliked,using c# and not java script. how to trigger that confirm box with this code.
pls help
……………………………………..

There are a couple of options, if you are using AJAX then you can use the ModalDialogExtender to create a kind of ‘popup’ – say an ASP.NET control that appears over the top of the page and prompts for confirmation.
If not, the best way to interact with the user is still JavaScript, but from the sounds of it you want to cause the popup to occur from your C# code, based on some more logic for example. One option would be to set the ‘onclick’ attribute of a button, the value of which is interpreted as JavaScript and executed when the button is clicked (and it can abort the button click event if the JavaScript returns a value of 0).
This may come in useful, though it is in the VB.NET language:
http://authors.aspalliance.com/aldotnet/examples/cd.aspx
And here’s a good article on the topic from Microsoft, in C#:
http://www.asp.net/data-access/tutorials/adding-client-side-confirmation-when-deleting-cs
They apply to deletion, which is the more common reason to add a confirmation box, but the same technique can be used for ‘edit’ operations.

For more info: trigger confirm box

C Programming Language Tutorial » Search Results » ajax

trigger confirm box

Share this post:

Related Posts

Leave a Comment