First, it's probably better to write the line:

Int Bid=int.parse(DataList1.DataKeys[0].ToString());

as this:

int bid = Convert.ToInt32(DataList1.DataKeys[0]);

(The second contains only one conversion, not two.)


If the link button is simply redirecting the to the new page, then
there is no reason you even need the click event. If the data key
column of the information is named 'Id', bind that to the PostBackUrl
of the LinkButton. If you actually need to do some processing of data
before the redirect, then you can pass the data key through the
CommandArgument field. It would probably be a good idea to read about
the DataList a bit, specifically the 'ItemCommand' event.

Reply via email to