html 调用 aspx页面,html 页面及调用aspx页面中文乱码解决

有个向msn的弹出消息框

footer.ascx.cs:

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using HotelManageService.Hotel;

using SupNumb.Constants.User;

public partial class com_Footer10 : System.Web.UI.UserControl

{

protected void Page_Load(object sender, EventArgs e)

{

if (Session["CURRENTUSER"] != null)

{

HotelServiceUC uc = new HotelServiceUC();

if (uc.NewestFailureTeleRightAlterList(Convert.ToInt32(((SupNumb.Constants.User.UserInfo)Session["CURRENTUSER"]).OwnerHotelId)) >= 1)

{

Response.WriteFile("../com/foot.html");

}

}

}

}

foot.html:

//设置每隔几秒访问一次数据库

window.setInterval("checkNewMsg()", 10000);

function checkNewMsg() {

if (window.XMLHttpRequest) {

req = new XMLHttpRequest();

} else if (window.ActiveXObject) {

req = new ActiveXObject("Microsoft.XMLHTTP");

}

req.open("post", "../fun/sysWebChat.aspx?method=sysWebChat_checkNewMSG", false);

req.send();

if (req.readyState == 4) {

if (req.status == 200) {

//成功!

getDIV(req.responseText);

}

}

}

function getDIV(newmsg) {

var MSG1 = new CLASS_MSN_MESSAGE("", 200, 120, "电话修改失败信息提示:",

"的失败的电话权限修改信息,请浏览后对应重新修改!", newmsg,

"../system/TeleRightFailureAlter.aspx");

MSG1.rect(null, null, null, screen.height - 10);

MSG1.speed = 10;

MSG1.step = 5;

MSG1.show();

}

问题:红色部分及TeleRightFailureAlter.aspx部分中文乱码

解决办法:Web.config配置文件的

内加入

requestEncoding="gb2312"

responseEncoding="gb2312"

/>

且TeleRightFailureAlter.aspx文件的加上ResponseEncoding="gb2312"

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值