朋友反映Blog在切换皮肤时总失效
加载css时会失败
我一直没遇到过
今天让我遇到了一把:
进首页时,突然无法加载css
查看源代码
[code]
[/code]
发现skins后面成乱码了,当然无法加载了,但为什么会这样呢?
读取cookie的代码
[code]
public static string getStyleList()
{
StringBuilder sb = new StringBuilder(1000);
string _style_name = "default";
if (System.Web.HttpContext.Current.Request.Cookies["styleName"] != null)
{
_style_name = HttpContext.Current.Request.Cookies["styleName"].Value;
}
sb.Append(string.Format(@"
", _style_name));
return sb.ToString();
}
[/code]
这个cookie是不可能为中文的,全英文加数字,为什么会出现读取时乱码的情况?
找找原因,马上处理一下