I use JavaScript and this error appears for me during execution:
Microsoft JScript runtime error: 'document.getElementById(...)' is null or not an object
this my code:
<asp:Content ID="content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script language="javascript" type="text/javascript">
function ConfirmTransfere() {
if (confirm("Syatem not allow negative inventory, would you like to continue ?") == true) {
document.getElementById("btnAlelrt").click();
}
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="uxContainer" runat="server">
<ContentTemplate>
<table>
<tr>
<td>
<asp:Button ID="uxTransfer" runat="server" Text="Transfer" OnClick="uxTransfer_Click" />
<asp:Button ID="btnAlelrt" runat="server" Text="GetDetails" OnClick="btnAlelrt_Click" />
</td>
</tr>
</table>
</ContentTemplate>
<Triggers>
<asp:PostBackTrigger ControlID="uxTransfer" />
</Triggers>
</asp:UpdatePanel>
</asp:Content>