I am getting "Microsoft JScript runtime error" when running web application that uses DevExpress controls.
I have got a user control hierarchy as follows:-
Default.aspx
|
-> Site.Master
|
-> LoadInvoiceTab
|
-> LoadInvoiceTabHeader
LoadInvoiceTabHeader 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 : |
|
|
After running the website I was getting following error message:-
Microsoft JScript runtime error: Unable to get value of the property 'LoadInvoiceTabHeader_btnSave_Click': object is null or undefined
The 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
Great Article
ReplyDeleteASP.NET MVC Training
Online MVC Training
Online MVC Training India
Dot Net Training in Chennai
.Net Online Training
.net training online
Dot Net Online Training
C# Training