Problem with design time rendering in VS2005

S

Showjumper

I have made a server control to display the average rating for content by
showing the number of stars. The problem i have is with the design time
display in vs 2005. It seems the problem with the design time rendering is
due to the calls to the databse helper class. Delete those lines and it
displasy fine in deign time. The code is below
Any ideas on how to make design time work?
Thanks Ashok

Dim dbutil As New DBHelper

Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)

dbutil.ProductID = _productid

Dim average As Single = dbutil.GetAverage

If average <> 0 Then

Select Case CInt(average * 4)

'load the right star image based on the rating

End Select

output.Write("Rating: ")

MyBase.Render(output)
 
G

Gary Vidal

just add this
If( this.DesignMode ) Then
' Do designmode stuff
Else
'Your Original code
End If
 

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