The following code is the code behind of a blank page (With a scriptmanager)
on which I'm trying to simulate a problem I'm having elsewhere in a larger
app.
The app is supposed, in this case, to dynamically create a textbox and a
MaskEditExtende r and associate the 2 together.
I'm obviously doing something wrong as I'm getting a exception.
-------------------------------------------------------------
[NullReferenceEx ception: Object reference not set to an instance of an object.]
AjaxControlTool kit.MaskedEditE xtender.OnLoad( EventArgs e) +168
System.Web.UI.C ontrol.LoadRecu rsive() +65
System.Web.UI.C ontrol.LoadRecu rsive() +190
System.Web.UI.C ontrol.LoadRecu rsive() +190
System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint) +2603
-------------------------------------------------------------
Any Ideas?
--
Rory
-------------------------------------------------------------
Public Partial Class ControlTesting
Inherits System.Web.UI.P age
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Controls.Add(Ne w SpecialControl)
End Sub
End Class
Public Class SpecialControl
Inherits WebControl
Implements INamingContaine r
Private Sub SpecialControl_ Load(ByVal sender As Object, ByVal e As System.EventArg s)
Handles Me.Load
Dim ControlAsTextBo x As New TextBox
ControlAsTextBo x.ID = "TextBox"
ControlAsTextBo x.CssClass = "textbox"
ControlAsTextBo x.AutoCompleteT ype = AutoCompleteTyp e.Disabled
Dim Mask As String = "LL-#####"
If Mask <String.Empty Then
Dim MyExtender As New AjaxControlTool kit.MaskedEditE xtender
MyExtender.Mask = Mask
MyExtender.Targ etControlID = ControlAsTextBo x.ID
MyExtender.Mess ageValidatorTip = True
MyExtender.OnFo cusCssClass = "MaskedEditFocu s"
MyExtender.OnIn validCssClass = "MaskedEditErro r"
MyExtender.Mask Type = AjaxControlTool kit.MaskedEditT ype.None
MyExtender.Inpu tDirection = AjaxControlTool kit.MaskedEditI nputDirection.L eftToRight
MyExtender.Acce ptNegative = AjaxControlTool kit.MaskedEditS howSymbol.None
MyExtender.Disp layMoney = AjaxControlTool kit.MaskedEditS howSymbol.None
MyExtender.Erro rTooltipEnabled = True
Controls.Add(My Extender)
End If
End Class
-------------------------------------------------------------