Getting a Confirmation Box to appear and get its value in th
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend3days leftRegister
Sandeep Singh ShekhawatRank #147 · 15.6K reputationPosted May 20, 2013, 11:57 PM EDT
foe example
on .aspx Page
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>title>
<script type="text/javascript">
function callMe()
{
var value = confirm('Are you Sure');
document.getElementById("<%= hfConfirmValue.ClientID%>").value = value;
}
script>
head>
<body>
<form id="form1" runat="server">
<div>
<asp:HiddenField ID="hfConfirmValue" runat="server" Value="" />
<asp:Button ID="btnSubmit" Text="Submit" runat="server" OnClientClick="callMe()" />
div>
form>
body>
html>
and .cs page you can access hidden field value
string hf = hfConfirmValue.Value.ToString();