1.在js里往aspx页面传值 用js自带的encodeURI()方法处理一下 示例
window.showModelessDialog(encodeURI("aa.aspx?r=随机数字"), self, "center:yes; scroll:no; help:no; dialogwidth:406px; dialogheight:340px");
2.Ajax 在js里调用.ashx文件 在.ashx文件里这样写
public void ProcessRequest (HttpContext context)
{
context.Response.ContentType = "text/plain";
context.Request.ContentEncoding = Encoding.GetEncoding("gb2312");
...
}
本文介绍了如何使用JS在aspx页面上传递参数,并通过Ajax调用ASHX文件进行数据交互,包括使用encodeURI处理URL参数和在ASHX文件中设置响应类型与内容编码。
2649

被折叠的 条评论
为什么被折叠?



