Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 3.5 > ASP.NET 3.5 Basics
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 20th, 2010, 07:05 AM
Registered User
 
Join Date: Mar 2010
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.

Thanks.
 
Old April 23rd, 2010, 12:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

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?

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
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!





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





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