Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Alert", "confirm('Are you Sure You Want to Delete User??')", true);
But now i remebered that i need an answer on the codebehinf(C#).
So this way i can do the rest of the code, but im stuck with that, does anybody knows how to do that??
Thanks and Regards
A different approach may be more helpful.. For example....
Add an asp:Hidden field in your form, to store the "user is sure" value. Set its default value to false.
when the form is submitted, use your btnSubmit_Click() function to check the asp:Hidden value: if that value is true, you know the user has already confirmed the "are you sure" dialog.
Refer this article:
But the problem im using a damn radgrid from telerik and using the delete field i have to start everything first fro mteh code behind.
Check out this article..
i wish it would be that easy,
but i cant use it because of the radgrid.
private void RadGrid_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
if (e.Item is GridDataItem)
GridDataItem dataItem = e.Item as GridDataItem;
string contactName = dataItem["SomeField"].Text;
LinkButton button = dataItem["ColumnName"].Controls as LinkButton;
button.Attributes["onclick"] = "return confirm('Are you Sure You Want to Delete User??')";