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. Advertisements

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 (here). After that, you can post your question and our members will help you out.