"Now it is saying that JavaScript runtime error: Unable to set property 'onclick' of undefined or null reference."
Any tips on how to fix this would be greatly appreciated.
Expand|Select|Wrap|Line Numbers
- $(document).ready(function () {
- var myButton = document.getElementById('<%= btnsubmit.ClientID %>');
- myButton.onclick = function () {
- var script = document.createElement("script");
- $.ajax({
- url: "testmenow.aspx",
- data: null,
- success: function (data) {
- $("#parttable").html(data);
- }
- });
- return false;
- }
- });
- ASP page
- <div id="parttable"> </div> <asp:Button ID="btnsubmit" runat="server" Text="click me" name="btnsubmit" />