autopostback and the back button
hi all,
i was wondering for somebody could help me out...so i'm using a dropdownlist, checkboxlist, with autopostback = true...i'm populating the boxlist with data against a ms sql server...the problem i'm having is that when i select a new item in the dropdown or checkbox, it post a new page with the updated changes to the dropdown/checkbox...so when i click the "back button" on the browser it would simply take me back to the previous dropdown item and not the previous page...so i do i get around this problem...if anybody can give me some suggestions, it will definitely make my day...thanks
Answers (2)
1
Try to give Session value before insert like below.
- try
- {
- Session["Vechilevalue"]=DropDownList1.SelectedValue;
- if(Session["Vechilevalue"]!=null&&!n.tbl_Vec.Any(x=>x.Vec_ID==Vec_ID))
- {
- v.Vec_ID=Vec_ID;
- {
- v.Vec_ID=DropDownList1.SelectedValue;
- }
- n.tbl_Vec.Add(v).ToString();
- n.SaveChanges();
- }
- else
- {
- }
- }
- catch
- {
- }