Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Building Controls > Rendering a derived drop down list in VS2005 designer view

Reply
Thread Tools

Rendering a derived drop down list in VS2005 designer view

 
 
postings@alexshirley.com
Guest
Posts: n/a
 
      02-16-2006
Hi

I have a control derived from a drop down list written in VB.NET
(ASP.NET 2.0) that dynamically displays listitems retrieved from an SQL
server database. My code works fine but when I go to designer view in
Visual Studio 2005 it renders a gray box displaying: "Error Creating
Control - MyDropDownList, object reference not set to an instance of an
object". Note the drop down list works perfectly in IE.

If I remove my code retrieving the values from SQL server and put in
static values, i.e.
----------------------------------------------------
Me.Items.Add(New ListItem("Select a Value", "0"))
Me.Items.Add(New ListItem("Test", "1"))
----------------------------------------------------

The drop down list will render in both the designer and IE.
So I am assuming that the VS2005 designer view will not render dynamic
listitems, but will render static listitems from dropdownlists.

In order to solve this problem I've looked at using:
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)

....to see if I can force rendering in the design view but no joy at
all, my approach isn't working here.

I don't really care if the designer renders the exact values from the
database, a couple of dummy values will do if necessary.

Can anybody help (I'm lost!).

Many thanks!

Alex

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
retrive preselected value in second drop down list from the first drop down list weiwei ASP .Net 0 01-05-2007 07:29 PM
Web derived controls in VS2005 designer view postings@alexshirley.com ASP .Net Building Controls 5 10-06-2006 09:52 AM
Rendering a derived control in design view (VS2005) postings@alexshirley.com ASP .Net 0 02-06-2006 10:46 AM
Rendering a derived control in design view (VS2005) postings@alexshirley.com ASP .Net 0 02-01-2006 03:28 PM
Auto Drop down a Drop Down List xxbmichae1@supergambler.com Javascript 5 11-23-2005 01:35 AM



Advertisments