How to keep your data during ajax call in asp.net? -
in asp.net page, using ajax, , want know how keep variable data when doing ajax call. on page load, download lot of information database , display on page. during ajax call, want use data stored in variable, problem is, during ajax call, data goes away, , have re download data again.
is there way keep during ajax call?
in asp.net have many ways this, session["yournamehere"]
have vale until sesion closed or viewstate["yournamehere"]
have value in page until closed.
some links using viewstate or using sesionstate hope help.
edit
using viewstate.
first put serializable in class.
[serializable] public class fruits { public string apple { get; set; }}
save value:
fruits fruit = yourmethod(); //yor method retrive data database* viewstate["fruit"] = fruit;
when you'll use viewstate:
fruits fruit = viewstate["fruit"]
Comments
Post a Comment