编码后 常理来说 是不会乱码的
注意 你R["IG_Name"] 取值 之后 是否 已乱码
public class HomeController : Controller
{
//
// GET: /Home/
public ActionResult Index()
{
return View();
}
public ActionResult IndexTwo()
{
ViewData["IG_Name"] = Request["IG_Name"];
return View();
}
}
Index.aspx
IndexTwo.aspx
<%=ViewData["IG_Name"] %>
后台:
Server.HtmlEncode(msg)
前台:
Server.HtmlDecode(msg)
编码都换UTF-8试试
换个传参方式,用表单+POST传
有没有试过对<%= R["IG_Name"]%>进行URL编码?