开发者

ASP.NET web shop product

开发者 https://www.devze.com 2023-03-14 04:54 出处:网络
I have a MS SQL database that contains my products(id, name, price...). Now... I\'ve displayed list of products using a data list. All the products name, description, price etc. gets converted to para

I have a MS SQL database that contains my products(id, name, price...). Now... I've displayed list of products using a data list. All the products name, description, price etc. gets converted to paragraphs and spans when the page is shown. I have a "details" linkbutton which becomes a link. When I click the link I want to go to a product details page. I can't post data since there are no tags, and its all paragraphs and spans.

  1. How should this be done? I'm pretty sure I fail at organisating more than coding, since I don't have much exp. in web application development.

  2. Is that the right way to do it? I mean, since the products live inside my database, I thought of displaying them in a list and when a user clicks on any of em, do form action="product.aspx" and post the name of the produc开发者_Python百科t(which is unique). After it's posted, onPageLoad in product.aspx get the product info from a db.


In the datalist, you can specify the datakeys which the list should use. I would use 'id' for this one.

Then, later on when a button is clicked, you can get the id from the event arguments that are fired and then use those.

0

精彩评论

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