p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 (http://p2p.wrox.com/book-asp-net-2-0-website-programming-problem-design-solution-isbn-978-0-7645-8464-0-264/)
-   -   Need help with this error in Beerhouse framework (http://p2p.wrox.com/book-asp-net-2-0-website-programming-problem-design-solution-isbn-978-0-7645-8464-0/94457-need-help-error-beerhouse-framework.html)

RachelKC May 5th, 2015 09:45 AM

Need help with this error in Beerhouse framework
 
This is in preview - not on web. It was working fine. Then the only thing I did was try out the shopping cart by adding an item and then following through to the point where you click to go to paypal. I stopped there and didn't follow through and just closed the preview window. Later when I tried to preview some pages, it keeps referencing an error in shopping cart code as shown below:

Server Error in '/A_Taurus' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

Line 12: <small>
Line 13: <asp:Image runat="Server" ID="imgProduct" ImageUrl="~/Images/ArrowR3.gif" GenerateEmptyAlternateText="true" />
Line 14: <%# Eval("Title") %> - <%# (this.Page as BasePage).FormatPrice(Eval("UnitPrice")) %> &nbsp;&nbsp;<small>(<%# Eval("Quantity") %>)
Line 15: <br /></small>
Line 16: </ItemTemplate>


Source File: c:\A_Taurus\Controls\ShoppingCartBox.ascx Line: 14

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
ASP.controls_shoppingcartbox_ascx.__DataBind__cont rol4(Object sender, EventArgs e) in c:\A_Taurus\Controls\ShoppingCartBox.ascx:14
System.Web.UI.Control.OnDataBinding(EventArgs e) +99
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +92
System.Web.UI.Control.DataBind() +15
System.Web.UI.Control.DataBindChildren() +211
System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding) +102
System.Web.UI.Control.DataBind() +15
System.Web.UI.WebControls.Repeater.CreateItem(Int3 2 itemIndex, ListItemType itemType, Boolean dataBind, Object dataItem) +124
System.Web.UI.WebControls.Repeater.CreateControlHi erarchy(Boolean useDataSource) +443
System.Web.UI.WebControls.Repeater.OnDataBinding(E ventArgs e) +51
System.Web.UI.WebControls.Repeater.DataBind() +75
MB.TaurusCorporation.UI.Controls.ShoppingCartBox.P age_Load(Object sender, EventArgs e) in c:\A_Taurus\Controls\ShoppingCartBox.ascx.cs:26
System.Web.Util.CalliHelper.EventArgFunctionCaller (IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Cal lback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627

Please help![:confused:]

RachelKC May 5th, 2015 10:10 AM

I just re-ran in preview mode and noticed the side bar showed shopping cart. I clicked that and removed the item I had in shopping cart and then tried to view the other pages which were throwing an error and now its working again.

I should still have some way of handling that error shouldn't I ? Or once uploaded if someone left something in shopping cart and closed the page, would they get that dreaded VS error page?


All times are GMT -4. The time now is 11:02 PM.

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