I am creating an application for posting advertisements for selling or buying items. I have a items table with item id as primary key and two other tables, 1) category table with id and name where id is a foreign key in the item table and 2) images table with id, name, byte[] to store images where imageId is the foreign key in items table.

In the home page I would like to display the items (image, title, price, etc) on the main content corresponding to the categories which are listed on the side menu. And the items displayed need to be clickable and should be opened on a separate page upon clicking. So far I have displayed the category names on the side menu by creating LinkButtons dynamically by looping through the DataSet, and I have successfully added command events to these category LinkButtons which carries the specific category's Id in the CommandName. And using that categoryId I was able to fetch the items belong to the categoryId from the items table, and display the Title in linkButton, image in an image Control (using Generic Handler), and eveything else in label controls, by doing the same process of looping through the corresponding DataSet, creating the above said controls dynamically but where I am failing is, the command event that I have attached to the link button which displays the Title of the posting(which needs to be redirected to a separate page of the specific item) does not respond to the click, it goes back to the first item in the categories and shows the advertisements (postings) belong to that. Would any one of you be able to tell me whether I am in a wrong way or is there any other way to get this done? like using any other controls ?

Related posts

Recent Viewed