Hi folks,
I am quite new to Web application development. I need to display a popup (confirmation) message in asp .net application.
on event of button click in my application vbscript function is called to execute certain functions.
Actual requirement is :
..
functions are executed removed for brevity..
..
if(confirm(popupmsg) == "cancel") // Show a popup message& if response is cancel then return from c# code.
{
return; // I should return
}
Any help appreciated.
Thanks,
Shankar M

Khargesh RajputPosted Dec 23, 2014, 12:13 AM
button.Attributes.Add("onclick", "javascript:if(confirm('Are you sure you want to delete?'))return true; else return false;");
Shankar MPosted Dec 22, 2014, 4:39 AM
Thanks for your reply.
I am using a html button control & I have binded vbscript function already in the tag.
<button accesskey="G" style="z-index: 0;
width: 165px" id="bttn"
class="clsButton" onclick="vbscript:Gettn()" name="bttnG">
So how we can do this ?
Thanks,
Shankar M
Vikram AgrawalPosted Dec 22, 2014, 2:35 AM
You can write on button onclientclick event like below for you requirement
OnClientClick="return confirm('Are you confirm to do this')"
Joginder BangerPosted Dec 22, 2014, 1:47 AM
http://www.aspsnippets.com/Articles/Server-Side-Code-Behind-Yes-No-Confirmation-Message-Box-in-ASPNet.aspx