Page 1 of 1

'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 3:23 am
by dave_reach
Hi,

I have been working on a site using the Ablecommerce system. I have noticed now that when you click the "rate this item" button on the Product Page you get an error saying 'Object Reference not set to an instance of an object'. It was working at one time, i've no idea when it stopped working, and no idea how to go about debugging it as its an Ajax request.

The response from the server is:

'53|error|500|Object reference not set to an instance of an object.|'

The site itself lives at http://www.officenut.co.uk. I'd appreciate any help anyone can offer!

Thanks,
Dave.

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 7:09 am
by m_plugables
Check the ConLib/ProductReviewForm control. It seems that it is trying to use something which is NULL. If you post some exception details means the stack trace then it would be help full in finding where exactly the problem is.

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 7:54 am
by dave_reach
Hi,

I'll look in to that control and try and get the stack trace. I had a bit of a play around with the ProductReviewPanel control, and called ShowReviewForm() on Page_Load - this made the rating form visible without the need to click the "Rate this Item" button.

The form worked fine and I was able to submit a review. Hmm!

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 8:00 am
by m_plugables
Also check ConLib/ProductReviewsPanel control as well. In fact this control is showing the rate this item hyper link and then when some one click the hyper link button it calls the
InitializeForm(); function of the ConLib/ProductReviewForm. I think there is some problem in this InitializeForm(); function of ConLib/ProductReviewForm function.

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 8:54 am
by dave_reach
I'm unable to get a stack trace (I cant run the site in Debug mode - it just refreshes constantly). I've now commented out all the functions contained within the OnClick event for the button and I am still receiving the error message. Maybe I was editing the wrong button... 1 search for "Rate this item" in all files later and there is only this 1 instance. HMM!

I then tried removing OnClick="ReviewLink_Click" but the error popup was still being displayed OnClick.

I'm not so hot on this Ajax related .NET stuff, but surely by removing the OnClick event from the .aspx page I should be removing its OnClick event!

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 10:31 am
by m_plugables
If it is possible then attach all the modified files for both controls. I will try to have a look at them when i have some spare time. I think this problem is because of some of your custom work.

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Fri Jun 27, 2008 12:53 pm
by Logan Rhodehamel
One tip for working with Ajax - it can be frustrating with the callback when you can't see the actual error message. If the bug isn't ajax related, you can disable the partial postback feature. That way you will be able to see the actual error messages that occur.

If you are working on the store side, edit the file Layouts/Scriptlet.master. If you are working on the admin side, it's Admin/Admin.master.

Code: Select all

EnablePartialRendering="true"
Change true to false to turn off ajax.

Re: 'Rate this Item' Object ref. not set to an instance...

Posted: Mon Jun 30, 2008 2:06 am
by dave_reach
Hi,

@mazhar
The review controls arn't customised themselves. Most of the other controls on this page have been modified though. I can attach these, but there are a lot of controls that I have changed.

@Logan Rhodehamel
I did as you advised and set EnablePartialRendering to false, and lo and behold the entire process works like a charm. However, setting it back to True causes the error to occur again. This leads me to think it's something related to the request itself as opposed to some scripting error.