Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / July 2006

Tip: Looking for answers? Try searching our database.

Problem with design time rendering in VS2005

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Showjumper - 23 Jul 2006 21:38 GMT
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)
Gary Vidal - 23 Jul 2006 22:44 GMT
just add this
If( this.DesignMode ) Then
 ' Do designmode stuff
Else
  'Your Original code
End If

Signature

Gary Vidal

> 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
[quoted text clipped - 24 lines]
>
> MyBase.Render(output)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.