是这样的:
我有两个页面,一个页面叫做ceshi.aspx,在这个页面的<body onload="startRequest();">
然后是Javascript中:
var xmlHttp;function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
xmlHttp=new XMLHttpRequest();
}
}function startRequest(){
createXMLHttpRequest();
xmlHttp.open("GET","isWebUser.aspx?url=oyangshuai",true);//我在这里请求了一个叫做isWebUser.aspx的页面
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);
}function handleStateChange(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200||xmlHttp.status==0){
alert(xmlHttp.responseText+" "+xmlHttp.status);
}
}
}然后是在isWebUser.aspx中我做了这样的操作:
protected void Page_Load(object sender, EventArgs e) //注意!我在这里加了断点!
{
string userid = "";//用户会员号
string userweb = Request.QueryString["url"];//链接请求的目标网站 if (Session["user"] == null)//判断会话状态
{
Response.Write("not login" + userweb + userid);
}
else if (userweb == null)//这个判断没什么用,请忽略
{
Response.Write("error");
}
else
{
userid = Session["user"].ToString();
DBcon t = new DBcon();
if (!t.isHaveWeb(userweb)) //这里就是一个执行成功的操作
{
t.updateIntegral(userid, "1"); Response.Write("ok");
}
else
{
Response.Write(userweb);
}
}
Response.End();
}
具体问题是这样:我点击ceshi.aspx时,在ceshi.aspx的页面呈现出的时候异步请求了isWebUser.aspx页面,应该去执行isWebUser.aspx页面的内容,
况且我在isWebUser.aspx中增加了断点,按理说每次点击ceshi.aspx时都应该在isWebUser.aspx页面中触发断点,但是我的只能是第一次点击ceshi.aspx时它才出发断点,再次点击时,无论怎么样它都不触发断点!但是还是能显示出xmlHttp.responseText,真不知道是怎么回事了,我也不知道我说的清除不清楚,希望各位高手帮忙看一看!小弟感激不尽!!
我有两个页面,一个页面叫做ceshi.aspx,在这个页面的<body onload="startRequest();">
然后是Javascript中:
var xmlHttp;function createXMLHttpRequest(){
if(window.ActiveXObject){
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}else{
xmlHttp=new XMLHttpRequest();
}
}function startRequest(){
createXMLHttpRequest();
xmlHttp.open("GET","isWebUser.aspx?url=oyangshuai",true);//我在这里请求了一个叫做isWebUser.aspx的页面
xmlHttp.onreadystatechange=handleStateChange;
xmlHttp.send(null);
}function handleStateChange(){
if(xmlHttp.readyState==4){
if(xmlHttp.status==200||xmlHttp.status==0){
alert(xmlHttp.responseText+" "+xmlHttp.status);
}
}
}然后是在isWebUser.aspx中我做了这样的操作:
protected void Page_Load(object sender, EventArgs e) //注意!我在这里加了断点!
{
string userid = "";//用户会员号
string userweb = Request.QueryString["url"];//链接请求的目标网站 if (Session["user"] == null)//判断会话状态
{
Response.Write("not login" + userweb + userid);
}
else if (userweb == null)//这个判断没什么用,请忽略
{
Response.Write("error");
}
else
{
userid = Session["user"].ToString();
DBcon t = new DBcon();
if (!t.isHaveWeb(userweb)) //这里就是一个执行成功的操作
{
t.updateIntegral(userid, "1"); Response.Write("ok");
}
else
{
Response.Write(userweb);
}
}
Response.End();
}
具体问题是这样:我点击ceshi.aspx时,在ceshi.aspx的页面呈现出的时候异步请求了isWebUser.aspx页面,应该去执行isWebUser.aspx页面的内容,
况且我在isWebUser.aspx中增加了断点,按理说每次点击ceshi.aspx时都应该在isWebUser.aspx页面中触发断点,但是我的只能是第一次点击ceshi.aspx时它才出发断点,再次点击时,无论怎么样它都不触发断点!但是还是能显示出xmlHttp.responseText,真不知道是怎么回事了,我也不知道我说的清除不清楚,希望各位高手帮忙看一看!小弟感激不尽!!
解决方案 »
- 关于GridView
- VS2003中,asp.net+sql server 2000的web系统,如何打包?
- 弹出确认框
- Control 'ctl04_0' of type 'RadioButton' must be placed inside a form tag with runat=server.
- ==========请问如何用回车来实现datagrid中的换行?=============
- asp.net 在ipad中运行问题
- js jquery 这个是什么意思呢?
- 有关datagrid删除列的问题!(急!!)
- 急救:在没有wwwroot的服务器上装程序,怎么解决问题.
- 高人救命呀!再线等!!
- Default.cs 下的代碼不能家命名空間,加了就報錯,錯誤如下:
- 高分求助“添加引用”的问题?
&rid=Math.random()