I am getting "Microsoft JScript runtime error" when running web application that uses DevExpress controls.
I have got a user control hierarchy as follows:-
After running the website I was getting following error message:-
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. ~Elbert Hubbard, The Roycroft Dictionary and Book of Epigrams, 1923
Default.aspx | -> Site.Master | -> LoadInvoiceTab | -> LoadInvoiceTabHeaderLoadInvoiceTabHeader has got some javascript code to handle client side events for DevExpress controls. script has been added toward end of the user control definition.
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="LoadInvoiceTabHeader.ascx.cs" Inherits="LoadInvoiceTabHeader" %>
Invoice No : |
|
||
Customer name : |
|
||
Delivery Address : |
|
||
|
Microsoft JScript runtime error: Unable to get value of the property 'LoadInvoiceTabHeader_btnSave_Click': object is null or undefinedThe reason for the script error is because devexpress controls try to evaluate SaveInvoice & CancelInvoice while rendering the page, but by this time the script written for clientside events were not assigned and hence generates an error. In order to render the script in advance all you need to do is just assign id for script tab with prefix with "dxss_". So script will now become
That's it this should solve the issue.
One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man. ~Elbert Hubbard, The Roycroft Dictionary and Book of Epigrams, 1923