i m shoeing different fields from database also i m using a variable"totRent2" from codebehind in itemtemplate of datalist
all works fine axcept variable problem is that.
if i use"<%=totRent2%>" it overWrite by the last calculated total(say car a has totrent 10,car b has totrent 20 and car c has totrent 30 in code behind but it show 40 for all cars total)
if i use"<%#totRent2%>" it works but it does'nt show totrent for car a instead it shows the totrent of car a in car b car b in car c
any idea to solve this or any other idea for this solution..........................
<
{
int it = e.Item.ItemIndex;
id = (int)DataList1.DataKeys[it];
Bll bll = new Bll();
DataSet ds = bll.sendSelectedCarID(id);
foreach (DataRow rows in ds.Tables[0].Rows)
DateTime start = DateTime.Parse(lbsdate.Text);
DateTime end = DateTime.Parse(lbrdate.Text);
totdays = (end - start).Days;
rent =
}
tot = rent * totdays;
totRent2 = tot.ToString();//.....this is variable which i am using in inline code-----------------------