R
Roberto Kohler
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?
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?