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");
...
}
本文详细介绍了如何在JavaScript中向ASP.NET页面传递参数,并通过Ajax调用ASHX文件的方法。包括使用encodeURI处理URL参数、设置窗口模式显示对话框以及在ASHX文件中响应请求的实现细节。
2649

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



