HighTechTalks DotNet Forums  

Problem with design time rendering in VS2005

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Problem with design time rendering in VS2005 in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Showjumper
 
Posts: n/a

Default Problem with design time rendering in VS2005 - 07-23-2006 , 04:38 PM







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)




Reply With Quote
  #2  
Old   
Gary Vidal
 
Posts: n/a

Default Re: Problem with design time rendering in VS2005 - 07-23-2006 , 05:44 PM






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

--
Gary Vidal



"Showjumper" <dfgkjhdf> wrote

Quote:
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)






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.