View Single Post
  #2 (permalink)  
Old December 5th, 2011, 05:45 AM
sam0sunny sam0sunny is offline
Authorized User
 
Join Date: Sep 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

just bind a grid view to ur db table with details u want along with a column 'View' having id of race.
run a loop which will create a new imagebutton with id as that of race id and add a click event handler to these buttons with same method to be called.
ex:
for(int i=0;i<gvRace.rows.count;i++)
{
imagebutton imb=new imagebutton();
imb.id=gvRace.rows[i].cell[0].text;//or value
imb.imageUrl="";//any image u like
imb.click+=new eventhandler(imb_click);
gvRace.Rows[i].cell[0].controls.add(imb);
}

and in the click event just find the imagebutton id which is actually ur race id and pass it to next page via query string or session

protected void imb_click(object sender,ImageButtonEventAgrs e)
{
control imb=(control)sender;
server.transfer("raceDetail.aspx?rid="+imb.id);
}
Reply With Quote