get方式传参时,中文乱码的解决方法:

法1:
      在<system.web>节点中添加
   <globalization requestEncoding="gb2312" responseEncoding="gb2312" fileEncoding="gb2312" culture="zh-cn" />
法2:在页面的<head>节点中添加:<meta http-equiv="Content-Type" Content="text/html;charset=gb2312"
法3:使用Server.Encode() 进行编码,使用Server.Decode()进行解码
 
页面提交时异常信息为:验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGenerate
解决方法:
在页面的<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
改成:<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" EnableViewStateMac="false"   CodeFile="Default2.aspx.cs" Inherits="Default2" %>

相关文章:

  • 2022-12-23
  • 2021-10-17
  • 2021-12-24
  • 2022-12-23
  • 2021-08-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2021-10-02
  • 2020-10-17
  • 2021-06-21
  • 2021-06-09
  • 2022-02-05
  • 2021-08-31
相关资源
相似解决方案