I am working on a project where I need to store form details and trigger a popup box when the submit button is clicked. To achieve this, I used try { } finally { }
. However, I am unsure of how to link the popup box function in JavaScript to the C# file.
Below is the code snippet for JavaScript:
<script>
function xpopup() {
document.getElementById("x").onclick = function ()
{
var overlay = document.getElementById("overLay");
var popup = document.getElementById("xPopup");
overlay.style.display = "block";
popup.style.display = "block";
}
}
</script>
And here is the code snippet for C#:
try { }
finally
{
ScriptManager.RegisterClientScriptBlock(this, GetType(), "none", "<script>function xpopup();</script>", false);
}