场景:当我单击 ext:ComboBox 中的项目并想要将项目选择值设置为 cookie 变量时。最后,在我点击 ext:Button 后,ext:Label 获取 cookie 值并显示出来。
但我收到一个错误:Ext.Ajax Communication Failure,任何帮助将不胜感激。
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);
}