Problem with web server control placed on web user control

O

okaminer

Hi
My problem is this
I have a datetimepicker "Web server control", which I put on a "web
user control".

When I put the "web user control" on a web form, and try to open this
web form, the following error is raised:
"[NullReferenceException: Object reference not set to an instance of an
object.]
DTPicker.DateTimePicker.Render(HtmlTextWriter output)" .....

I'm a newb in asp.net and I'm not sure where the control initialization
is happening.

Any help on the matter would be highly appreciated since I really don't
know where to go from here
thanks
 
O

okaminer

The behind code is below
My problem is with the DateTimePicker Control

I have isolated the problem alittlebit and found out that the proccess
stops at function DateTimePicker2setfocusonload() during the rendering
because the DateTimePicker I believe is not set, the failure is "Object
expected"

By the way the control does works from simple web page


The User Control Code behind:
----------------------------

Public Class ucVisitData
Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub
InitializeComponent()

End Sub
Protected WithEvents dropDownListHour As
System.Web.UI.WebControls.DropDownList
Protected WithEvents DateTimePicker2 As DTPicker.DateTimePicker
Protected WithEvents dropDownListMinutes As
System.Web.UI.WebControls.DropDownList
Protected WithEvents TextBox1 As System.Web.UI.WebControls.TextBox

'NOTE: The following placeholder declaration is required by the Web
Form Designer.
'Do not delete or move it.
Private designerPlaceholderDeclaration As System.Object

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()

End Sub

#End Region

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
End Class
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top