Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Problem with web server control placed on web user control

Reply
Thread Tools

Problem with web server control placed on web user control

 
 
okaminer
Guest
Posts: n/a
 
      02-08-2005
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

 
Reply With Quote
 
 
 
 
Gopal \(FMS, Inc.\)
Guest
Posts: n/a
 
      02-08-2005
Can you please post your code behind so that someone may be able to find why
it is breaking?
Thanks
--
Gopal Rangaswamy
Microsoft Certified Solutions Developer
FMS, Inc.
<http://www.fmsinc.com/consulting>
<http://www.fmsinc.com/dotnet/SourceBook/>

"okaminer" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) ups.com...
> 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
>



 
Reply With Quote
 
 
 
 
okaminer
Guest
Posts: n/a
 
      02-08-2005
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Raising an event in the aspx page for a user control placed inside aRepeater Ram ASP .Net 0 10-30-2009 08:56 AM
User Control Button Click event not firing when placed in a Web form ~~~ .NET Ed ~~~ ASP .Net 3 09-08-2008 05:36 AM
What is the best practice to have a user control placed multiple times on a page? Gummy ASP .Net 9 09-19-2006 03:32 PM
Loading Dynamic User Control Error: "The control must be placed inside a form tag with runat=server" Help Please Second time posting. davidr@sharpesoft.com ASP .Net 0 08-31-2006 05:26 PM
Retrieving values in user control placed in placeholder ctrl =?Utf-8?B?Sm9l?= ASP .Net 1 12-13-2005 09:48 PM



Advertisments