Hi I am trying to call a button click function written within the c# code behind from javascript. but its not triggering the button click function. I didnt find anything suspicious in the code. Please check and let me know what is actually blocking the call. These are my code scraps.
<script language="javascript" type="text/javascript">
function ConfirmFuncn() {
var Msge = document.getElementById('<%=hdnMsge.ClientID %>').value;
if (confirm(Msge)) {
document.getElementById('<%=hdnTestValue.ClientID %>').value = "true";
}
else {
document.getElementById('<%=hdnTestValue.ClientID %>').value = "false";
}
document.getElementById('<%=btnSaveHidden.ClientID %>').Click();
}
</script>
<asp:Button ID="btnSaveHidden" runat="server" Visible="false"
Text="HiddenSaveButton" onclick="btnSaveHidden_Click"
/>
Here it does not call btnSaveHidden_Click
. Javascript function ConfirmFuncn
is calling properly, because i am getting the message value I set to hidden field. But btnSaveHidden_Click
is not triggering. Why?