类似赶集http://bj.ganji.com/fang1/
最上面的选择区域:全北京海淀朝阳东城西城崇文宣武丰台石景山房山大兴通州顺义昌平密云怀柔延庆平谷门头沟燕郊 租金:不限600元以下600-1000元1000-1500元1500-2000元2000-2500元2500-3000元3000-5000元5000元以上 方式: 整租 合租单间合租床位房型: 不限一室二室三室四室五室五室以上 怎样做啊,每点击一个连接,其他的跟着都变,这种选择怎样做啊,谁能帮忙看下,给写个例子啊,感激不尽我这样模仿的写不对,请高手指教
string questring = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
questring = Request.Url.Query;
Response.Write(daohang());
}
} string str = "";
public string daohang()
{
if (questring == "")
{
str += "<a href='webform1.aspx?type1=1'>类别11</a> <a href='webform1.aspx?type1=2'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21'>类别21</a> <a href='webform1.aspx?type2=22'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31'>类别31</a> <a href='webform1.aspx?type3=32'>类别32</a></br>";
}
else
{
if (Request.QueryString["type1"] != null)
{
str += "<a href='webform1.aspx?type1=1'>类别11</a> <a href='webform1.aspx?type1=2'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21&" + questring + "'>类别21</a> <a href='webform1.aspx?type2=22&" + questring + "'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31&" + questring + "'>类别31</a> <a href='webform1.aspx?type3=32&" + questring + "'>类别32</a></br>";
return str;
}
if (Request.QueryString["type2"] != null)
{
str += "<a href='webform1.aspx?type1=1&" + questring + "'>类别11</a> <a href='webform1.aspx?type1=2&" + questring + "'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21'>类别21</a> <a href='webform1.aspx?type2=22'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31&" + questring + "'>类别31</a> <a href='webform1.aspx?type3=32&" + questring + "'>类别32</a></br>";
return str;
}
if (Request.QueryString["type3"] != null)
{
str += "<a href='webform1.aspx?type1=1&" + questring + "'>类别11</a> <a href='webform1.aspx?type1=2&" + questring + "'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21&" + questring + "'>类别21</a> <a href='webform1.aspx?type2=22&" + questring + "'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31'>类别31</a> <a href='webform1.aspx?type3=32'>类别32</a></br>";
return str;
}
}
return str;
}
最上面的选择区域:全北京海淀朝阳东城西城崇文宣武丰台石景山房山大兴通州顺义昌平密云怀柔延庆平谷门头沟燕郊 租金:不限600元以下600-1000元1000-1500元1500-2000元2000-2500元2500-3000元3000-5000元5000元以上 方式: 整租 合租单间合租床位房型: 不限一室二室三室四室五室五室以上 怎样做啊,每点击一个连接,其他的跟着都变,这种选择怎样做啊,谁能帮忙看下,给写个例子啊,感激不尽我这样模仿的写不对,请高手指教
string questring = "";
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
questring = Request.Url.Query;
Response.Write(daohang());
}
} string str = "";
public string daohang()
{
if (questring == "")
{
str += "<a href='webform1.aspx?type1=1'>类别11</a> <a href='webform1.aspx?type1=2'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21'>类别21</a> <a href='webform1.aspx?type2=22'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31'>类别31</a> <a href='webform1.aspx?type3=32'>类别32</a></br>";
}
else
{
if (Request.QueryString["type1"] != null)
{
str += "<a href='webform1.aspx?type1=1'>类别11</a> <a href='webform1.aspx?type1=2'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21&" + questring + "'>类别21</a> <a href='webform1.aspx?type2=22&" + questring + "'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31&" + questring + "'>类别31</a> <a href='webform1.aspx?type3=32&" + questring + "'>类别32</a></br>";
return str;
}
if (Request.QueryString["type2"] != null)
{
str += "<a href='webform1.aspx?type1=1&" + questring + "'>类别11</a> <a href='webform1.aspx?type1=2&" + questring + "'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21'>类别21</a> <a href='webform1.aspx?type2=22'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31&" + questring + "'>类别31</a> <a href='webform1.aspx?type3=32&" + questring + "'>类别32</a></br>";
return str;
}
if (Request.QueryString["type3"] != null)
{
str += "<a href='webform1.aspx?type1=1&" + questring + "'>类别11</a> <a href='webform1.aspx?type1=2&" + questring + "'>类别12</a></br>";
str += "<a href='webform1.aspx?type2=21&" + questring + "'>类别21</a> <a href='webform1.aspx?type2=22&" + questring + "'>类别22</a></br>";
str += "<a href='webform1.aspx?type3=31'>类别31</a> <a href='webform1.aspx?type3=32'>类别32</a></br>";
return str;
}
}
return str;
}
能给说清点吧 最好给写个demo 谢谢了区域:全北京海淀朝阳东城西城崇文宣武丰台石景山房山大兴通州顺义昌平密云怀柔延庆平谷门头沟燕郊 租金:不限600元以下600-1000元1000-1500元1500-2000元2000-2500元2500-3000元3000-5000元5000元以上 方式: 整租 合租单间合租床位房型: 不限一室二室三室四室五室五室以上
区域:全北京海淀朝阳东城西城崇文宣武丰台石景山房山大兴通州顺义昌平密云怀柔延庆平谷门头沟燕郊 租金:不限600元以下600-1000元1000-1500元1500-2000元2000-2500元2500-3000元3000-5000元5000元以上 方式: 整租 合租单间合租床位房型: 不限一室二室三室四室五室五室以上之后用js填写到页面上.
每次筛选都去读其中的查询条件,再查询
if(window.XMLHttpRequest)
{
xHRObject=new XMLHttpRequest();
}else if(window.ActiveXObject)
{
xHRObject=new ActiveXObject("MicrosoftXMHTTP");
}function SendRequest(method,url,data,callback)
{
if(url.indexOf("?")>0)
{
url+="&date="+new Date().getTime();
}
else
{
url+="?date="+new Date().getTime();
}
xHRObject.open(method,encodeURI(url),true);
//xHRObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
xHRObject.send(data);
xHRObject.onreadystatechange=function()
{
if(xHRObject.readyState==4)
{
if(xHRObject.status==200 || xHRObject.status==304)
{
callback(xHRObject);
}
}
}
}这是前台调用ajax的js代码
var gsno;
var gcno;
var gcnumber;
function addLate(sno,cno,cnumber)
{
gsno=sno;
gcno=cno;
gcnumber=cnumber;
var late="late"
SendRequest("GET","ajax.aspx?late="+late+"&Sno="+sno,null,callLate);
}
// string cno = Request.QueryString["cno"];
// string cnumber = Request.QueryString["cnumber"];
function callLate(xHRObject)
{
if(xHRObject.responseText=="yes")
{
//window.location.href="rollcall.aspx?cno="+gcno+"&cnumber="+gcnumber;
document.getElementById("div"+gsno).innerHTML="迟到";
return true;
}
else
{
document.getElementById("div"+gsno).innerHTML="操作失败";
return false;
}
}服务器端代码using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using BLL1;
using System.IO;namespace curriculum
{
public partial class ajax : System.Web.UI.Page
{
blluser users = new blluser();
protected void Page_Load(object sender, EventArgs e)
{
string result = string.Empty;
//迟到
if (!string.IsNullOrEmpty(HttpContext.Current.Request.QueryString["late"]))
{
string sno=HttpContext.Current.Request.QueryString["Sno"].ToString();
if (users.isAddLate(sno))
{
result = "yes";
}
else
{
result = "no";
}
Response.Write(result);
}
}
}
}
jquery+urlrewrite呗
jquery实现不刷新页面取数据同时点击某个参数选项后,把该参数以url方式保存至其他选项的点击链接里
urlrewrite分析出参数交给具体页面处理当然像上面用cookie或session之类的保存参数也可以,个人觉得不理想
建好表 联查应该可以吧这样行吗~~~
select '信息' from '表'
wehre '地区'=CASE WHEN 0 THEN '地区' ELSE '地区参数'
AND '地址'=CASE WHEN 0 THEN '地址' ELSE '地址参数'
AND '价格'=CASE WHEN 0 THEN '价格' ELSE '价格参数'
AND......传参数的时候比如GETALL(0,0,0,...)
选中地区1 GETALL(1,0,0,...)
地址2 GETALL(1,2,0,...)