Problem with web server control placed on web user control

Discussion in 'ASP .Net' started by okaminer, Feb 8, 2005.

  1. okaminer

    okaminer Guest

    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
     
    okaminer, Feb 8, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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
    >
     
    Gopal \(FMS, Inc.\), Feb 8, 2005
    #2
    1. Advertising

  3. okaminer

    okaminer Guest

    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
     
    okaminer, Feb 8, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ~~~ .NET Ed ~~~
    Replies:
    3
    Views:
    15,130
    nizarbabu
    Sep 8, 2008
  2. =?Utf-8?B?Sm9l?=
    Replies:
    1
    Views:
    3,307
    Peter Rilling
    Dec 13, 2005
  3. Replies:
    0
    Views:
    2,080
  4. Gummy
    Replies:
    9
    Views:
    472
    Sean Chambers
    Sep 19, 2006
  5. Ram
    Replies:
    0
    Views:
    387
Loading...

Share This Page