Hi,
I want to have application level client side caching in asp.net
I have the following scenario. And doing the following currently:
Works fine in my local machine.
A master page and multiple content pages.
In master page I have a dropdown to select States in a country.
on the select of which I am assigning it to
Cache["State"]=ddlStates.SelectedItem.value;
and in some pages I need to populate the repeaters depending on the state selected as follows:
protected override void OnInit(object sender, EventArgs e)
{
if(ViewState["StateFromGlobal"]==null)
{
ViewState["StateFromGlobal"]=Cache["State"];
}
}
public void BindRepeater()
{
myRepo=new BLLRepo();
repeater1.datasource=myRepo.GetResultsByState(string.IsnullorWhiteSpace(Cache["State"].toString())?"":Cache["State"].toString())
repeater1.DataBind();
}
the above line of code says that fetch the Results matching the value in the Cache["State"]. If it is empty I'm using other sql Command that selects all the results regardless of the states.(However this is not concern rigth now).
But the Problem is!!
My doubt is if I deploy this on the web server and If any user in one city selects state "A" from dropdown having States "--Select State--", "A", "B", "C",...."Z" then, is that so the other user who visits the website sees "A" selected by default or the Default value "--Select State--"??
If this doesn'tAny other alternative's to ma