c# - Check Object Exists throws Object Required Error -
i have web form data entry. page requires id passed via query string. in code behind check id has been supplied. if hasn't form (in panel) hidden , error message displayed.
in html have jquery script block attaches event (downloaded date picker).
window.onload = function() { new jsdatepick({ usemode: 2, target: "txtdateofincident", dateformat: "%d %m %y" }); };
if code behind hides form jquery throws error object required
so in jquery trying test existance of object as per post...
window.onload = function() { if ($('#txtdateofincident').length) { new jsdatepick({ usemode: 2, target: "txtdateofincident", dateformat: "%d %m %y" }); } };
now object required
error on $('#txtdateofincident').length
code.
any resolve appreciated.
i think better if set client id mode of txtdateofincident clientidmode="static".
<asp:textbox id="txtdateofincident" runat="server" clientidmode="static" />
Comments
Post a Comment