我的index.aspx的一个按钮btn_bool
{
string istrue;
string filepath="bookshow.aspx?id=25"
istrue=??
//这里得到"bookshow.aspx?id=25"网面的值 也就是false或true
}bookshow.aspx
load
{
string id=request.QueryString["id"].tostring
if(id!="100")
{
response.write("true");
}
else
{
response.write("false");
}
}谢谢
PS:bookshow.aspx页面是没有任何代码的
{
string istrue;
string filepath="bookshow.aspx?id=25"
istrue=??
//这里得到"bookshow.aspx?id=25"网面的值 也就是false或true
}bookshow.aspx
load
{
string id=request.QueryString["id"].tostring
if(id!="100")
{
response.write("true");
}
else
{
response.write("false");
}
}谢谢
PS:bookshow.aspx页面是没有任何代码的
string istrue;
string filepath="bookshow.aspx?id=25"
if( Session["IsTrue"] !=null)
{
string isture = Session["isTrue"].ToString();
}
istrue=??
//这里得到"bookshow.aspx?id=25"网面的值 也就是false或true
}bookshow.aspx
load
{
string id=request.QueryString["id"].tostring
if(id!="100")
{
Session["IsTrue"] = "true"; }
else
{
Session["IsTrue"] = "false";
}
}
是要记取这个网页返回的值
然后我的index.aspx根据这个xml做相应的事情
引用 using System.Net; using System.IO;
WebRequest request = WebRequest.Create("bookshow.aspx");
WebResponse response = request.GetResponse();using(Stream resStream = response.GetResponseStream())
{
using(StreamReader sr = new StreamReader(resStream, System.Text.Encoding.UTF8))
{
Response.Write(sr.ReadToEnd()));//此为你要取bookshow.aspx输出的true/false
}
}
我碰到过;使用的上述方法实现的
不知可否帮上楼主
Response.Write("<?xml version=\"1.0\" encoding=\"utf-8\" ?>");
Response.Write("<root>");
Response.Write("<IsUpdateOK>");
Response.Write("1");
Response.Write("</IsUpdateOK>");
Response.Write("</root>");
这种方法得到返回值不知道有没有更高明的
http://dotnet.aspx.cc/article/4ae836f8-ccb4-4bef-90b1-25bb1a5e6433/read.aspx
http://dotnet.aspx.cc/article/0a6660ce-4138-41ef-b882-15db65564709/read.aspx
http://fenglin.xland.cn
------------------------