Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble with AJAXControlToolkit - MaskedEdit Control

Status
Not open for further replies.

techsaad

Programmer
Dec 31, 2008
6
US

Hi,
I am using the maskededitextender server control from the Microsoft AJAX Control Tool kit in my webform (ASP .NET 2.0 Visual Studio 2005).

I have declared several instances of the <AjaxToolkit:maskededitextender> control.

There are no compile errors in the webpage. When I run the page, I get this error:


Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[NullReferenceException: Object reference not set to an instance of an object.]
AjaxControlToolkit.MaskedEditExtender.OnLoad(EventArgs e) +132
System.Web.UI.Control.LoadRecursive() +49
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Control.LoadRecursive() +132
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3747

I have NO idea where to even begin to tackle this error. There is no line number in the error. It seems that the error is in the OnLoad event handler of one of the MaskedEditExtender controls - but firstly, which one? Secondly, I don't have an OnLoad event handler defined for the control. This must be code that is generated automatically or is called implicitly by .NET . Can anyone give me some direction on how to resolve this error?


Thank you in-advance for reading this post and for helping with the problem.


Saad
 
you may be missing a required property for the masked editor. although I would think a more detailed exception would be thrown. check the examples and doc to make sure all the properties required are set.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 

My control tag has all of the required properties.

Here is one of the tags.

<ajaxToolkit:maskededitextender id="maskedEditPhone" runat="server" targetcontrolid="txtPhoned" mask="(999)-999-9999" masktype="number" messagevalidatortip="true" onfocuscssclass="MaskedEditFocus" oninvalidcssclass="MaskedEditError" />

All other tags look like this one - some just have a different mask.

Saad

 
it could be an underlying error is caught and swallowed. then when the current error is thrown the details of what really happened are lost.

i haven't worked with the ms ajax library too much. try deleting the control from the form altogether and run the page. fix any errors that would occur. then add the ajax control and test again.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top