!着急基础有关问题
在线等!!!着急!!!基础问题
前台AJAX,传到后台ashx页面, 里面跳转到同目录下的另外一个页面, 路径应该怎么写?
public void ProcessRequest(HttpContext context)
{
context.Session["name"] = "111";
context.Response.Redirect("pageTwo");
context.Response.Write("location.href='http://localhost:32959/pageTwo.html';");
}
------解决思路----------------------
context.Response.Write(string.Format("window.location.href='{0}';", “你跳转的路径"));
------解决思路----------------------
localhost:32959
这个东西不要代码写死,每次启动调试,端口都不一样的
------解决思路----------------------
用相对路径,或者先获取当前工程路径,然后拼接,而不是把URL写死
前台AJAX,传到后台ashx页面, 里面跳转到同目录下的另外一个页面, 路径应该怎么写?
public void ProcessRequest(HttpContext context)
{
context.Session["name"] = "111";
context.Response.Redirect("pageTwo");
context.Response.Write("location.href='http://localhost:32959/pageTwo.html';");
}
------解决思路----------------------
context.Response.Write(string.Format("window.location.href='{0}';", “你跳转的路径"));
------解决思路----------------------
localhost:32959
这个东西不要代码写死,每次启动调试,端口都不一样的
------解决思路----------------------
用相对路径,或者先获取当前工程路径,然后拼接,而不是把URL写死