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.
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.
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.
精彩评论