Using jquery impromptu with c#
Hello,
I'm just starting to use jquery for the first time and I'm having a hard time figuring out how to get the value from a user selection prompt to my server side code. I've created a hidden field, but I'm not sure how to set this value in jquery. Here is my code
-
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="jquery-impromptu.min.js"></script>
<link href="jquery-impromptu.css" rel="stylesheet" />
<script type='text/javascript'>
$(function () {
$("#btn").click(function () {
$.prompt("Are you sure you want to delete the checked carts?", {
title: "Delete Carts",
buttons: { "Yes": true, "No": false }
});
return false;
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="btn" type="button" value="Test" />
<asp:HiddenField id="hdnYesNo" runat="server" value="" />
</div>
</form>
</body>
</html>
I need to be able to reference the value of hdnYesNo so I can decide to either run the delete code or just cancel out of the button click event.
Thank you