Getting a Confirmation Box to appear and get its value in thNarasimha Murthy13yAsked May 21, 2013, 3:38 AM1.9kLearn iOS ProgrammingGetting a Confirmation Box to appear and get its value in the code behind using Java Script ..,Please Send the suggestions ..,
Sandeep Singh Shekhawat13y agoPosted May 21, 2013, 3:57 AMYou can use Hidden filed:foe exampleon .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 valuestring hf = hfConfirmValue.Value.ToString();
Sandeep Singh ShekhawatPosted May 21, 2013, 3:57 AM
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();