چگونه می توانم از پیام هشدار جاوا اسکریپت در کد زیر استفاده کنم وقتی روی داده های ستون gridview (دکمه) کلیک می کنم؟
نویسنده :
HorizontalAlign="Left" VerticalAlign="Middle" Wrap="False" Width="30px"
ScriptManager.RegisterStartupScript(Page, this.GetType(), "AlertMessage", "", false);
جواب :
یک دکمه تابع js را در رویداد OnClientClick بزنید.
همانطور که می بینید تابع js delrecord () نامیده می شود
function delrecord() {
if (confirm("Are you sure want to Delete Record ?")) {
return true;
}
else {
return false;
}
}
-----------------------
ScriptManager.RegisterStartupScript(
this,
typeof(Page),
"Alert",
"",
false);