Design Time Error Rendering Control

Discussion in 'ASP .Net Web Controls' started by Roberto Kohler, Jan 13, 2006.

  1. I have written a custom control based on the Web Button Control.

    When I add the custom control to an aspx page I get the following error at
    Design Time

    Error Rendering Control
    An unhandled exception has ocurred.
    Object reference not set to an instance of an object.

    I don't get any compilation errors, and the control works fine.
    The problem is only that at Design Time.

    I've narrowed it down to the following 2 lines of code in a Protected
    Overridable Function in the class:

    Dim sConnStr As String =
    ConfigurationManager.ConnectionStrings("INETSDBConnectionString").ConnectionString
    Dim companyCode As String = Current.Session("companyCode ").ToString()

    If I comment these out, I don't get the Error Rendering Control at Design
    Time, but of course the control doesn't work.

    Can anyone tell me what is wrong and how to get around this?
    Roberto Kohler, Jan 13, 2006
    #1
    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. Barry Carr
    Replies:
    4
    Views:
    791
    Barry Carr
    Jan 15, 2004
  2. PV

    Design-time rendering of User Control

    PV, Oct 29, 2003, in forum: ASP .Net Building Controls
    Replies:
    7
    Views:
    368
    Teemu Keiski
    Nov 6, 2003
  3. Stephen Miller
    Replies:
    1
    Views:
    284
    Alessandro Zifiglio
    Jan 2, 2004
  4. Sam Fields

    Rendering DataGrid in a custom control at design time

    Sam Fields, Jan 15, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    148
    Sam Fields
    Jan 15, 2004
  5. PeterW

    Design Time Error: Error Rendering Control

    PeterW, Mar 29, 2006, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    350
    Steven Cheng[MSFT]
    Mar 30, 2006
Loading...

Share This Page