how to set(get) cookie value in ext.net
- by user591587
scene: when I click item in ext:ComboBox and want to set the item selected value to cookie variable. Finally, after I click ext:Button, the ext:Label get cookie value and display it.
But I get a error :Ext.Ajax Communication Failure , any help will be appreciated.
aspx:
<ext:ComboBox ID="ComboBox1" runat="server" StoreID="Store1" Width="100" Editable="false"
DisplayField="name" ValueField="value" Mode="Local" TriggerAction="All`enter code here`" EmptyText="Select a locale...">
.....
aspx.cs
protected void lngIndexChanged(object sender, DirectEventArgs e)
{
//Sets the cookie that is to be used by Global.asax
HttpCookie cookie = new HttpCookie("CultureInfo");
cookie.Value = ComboBox1.SelectedItem.Value ;
Response.Cookies.Add(cookie);
Label1.Text = cookie.Value;
//Set the culture and reload for immediate effect.
//Future effects are handled by Global.asax
Thread.CurrentThread.CurrentCulture = new CultureInfo(ComboBox1.SelectedItem.Value);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(ComboBox1.SelectedItem.Value);
}