开发者

asp.net shopping cart

开发者 https://www.devze.com 2023-02-22 10:34 出处:网络
Hi guys I am new to SO and also new to ASP.NET I am trying to implement a simple shopping cart/basket for my cousin who is planning to sell books he wants to import from certain countries from underg

Hi guys I am new to SO and also new to ASP.NET

I am trying to implement a simple shopping cart/basket for my cousin who is planning to sell books he wants to import from certain countries from underground authors.

I have designed the system and are building it on MVS and need someone who has experience in this area to analyse my code if possible.

I have pasted my code on PasteBin at http://pastebin.com/TsykcZPG

Errors I am encountered:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 

Compiler Error Message: BC30451: 'ShoppingCart' is not declared. It may be inaccessible开发者_运维技巧 due to its protection level.

Source Error:


Line 18:         ' The GridView will take our cart items one by one and use the properties
Line 19:         ' that we declared as column names (DataFields)
Line 20:         gvShoppingCart.DataSource = ShoppingCart.Instance.Items
Line 21:         gvShoppingCart.DataBind()
Line 22:     End Sub

Source File: C:\inetpub\vhosts\bookshop.hostinguk.org\httpdocs\ViewCart.aspx.vb    Line: 20

Please check it briefly and provide me with any solutions here.

Thank you all

Regards

Dan


Where is the definition of the ShoppingCart class? If it's not static, where is its declaration?

The error is telling you some good information:

'ShoppingCart' is not declared. It may be inaccessible due to its protection level.

Your code is referencing an object called ShoppingCart, which it can't seem to do in this context. Guessing based solely on the code we can see, it seems like ShoppingCart has some static members that you're trying to use. If that's the case, then you should be able to access them without a declaration as in your code.

However, the error message also mentions the object's protection level. Is ShoppingCart private? Are its members private or protected?

We'll need to see more about the ShoppingCart class, and possibly more about the current context of the code you've shown (I notice it's a partial class, is there more?) to be more specific, of course. But as it stands right now the compiler just isn't about to find/access that class.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号