Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 3.5 Basics If you are new to ASP or ASP.NET programming with version 3.5, this is the forum to begin asking questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #41 (permalink)  
Old April 20th, 2010, 07:05 AM
Registered User
Join Date: Mar 2010
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts

Just by simply running the web site you will see the errors that I face:

NullReferenceException on the below line if I bind my listview first...
for (loopCount = 0; loopCount < (rateItems.Length); loopCount++)

And ArgumentOutOfRangeException on the below line if I bind your control first...
Spaanjaars.Toolkit.ContentRating ratingControl = (Spaanjaars.Toolkit.ContentRating)lvTrustAccounts. Items[0].FindControl("Rating1");

The main method used to bind my listview and rating control is SetRatingUserIdAndBind(). The only alterations that I made to your control is that I commented out the ItemId and datasource thrown error exceptions.

  #42 (permalink)  
Old April 23rd, 2010, 12:27 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts

Hi again,

Are you sure this is the right code?

I still see a *lot* of irrelevant stuff, making it hard for me to see what this is all about and what is needed and what not. Why do I need to wade through lots of AJAX assemblies in the bin folder, AJAX control toolkit references in the code, zillions of nested divs, uncommented code, unused connection strings and more while not of them are related to the actual problem? The more clean up you do, the easier it's for me to see what's going on.

But most importantly: there is no code for the ListView's ItemDataBound so how do you think this will work in the first place? You call BindList which then forces the Rating control to check the datasource, but you're never even assigning one? Then in BindData you randomly pick the first item and try to set an ItemId? None of this makes any sense to me.

Finally, if you upload new code, please explain what the general process of your logic is. I see some properties where the getters and setters access a database (???) and some other LINQ query hocus pocus that doesn't make sense to an outsider, so I am a bit a loss here to see how you want this to work in the first place. What are you trying to do and display? What IDs are you trying to assign to the Ratiing control?


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate a ASP.Net Treeview control dotnetDeveloper ADO.NET 2 November 21st, 2008 07:25 AM
how to use asp.net we user control on asp 3.0 web i_shahid Java Basics 2 January 8th, 2008 09:04 AM
using asp.net web user control in asp 3.0 App i_shahid Classic ASP Professional 0 January 8th, 2008 07:32 AM
Control in ASP.NET Manisha0605 .NET Framework 2.0 1 March 29th, 2007 02:33 PM
XML use in ASP (pre .NET) Lucky Bastard Classic ASP XML 0 April 7th, 2005 11:08 PM

All times are GMT -4. The time now is 12:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.