Design Time Error Rendering Control

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?
 

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

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top