日期:2014-05-18  浏览次数:20468 次

Response.Redirect的问题!!!!!!
protected void btnSearch_Click(object sender, EventArgs e)
  {
   
  string StartDate = this.tbTargetCity.Text;
  string EndDate = this.tbTargetCity.Text;
  string CityCode = this.tbTargetCity.Text;
  string HotelName = this.tbHotelName.Text;
  Response.Redirect("HotelList.aspx?PageSize=10&nPages=1&StartDate=" + StartDate + "&EndDate=" + EndDate + "&CityCode=" + CityCode + "&HotelName=" + HotelName + "&PorName=&RankCode=" + this.ddlRank.SelectedItem.Value + "&RateMin=&RateMax=");
  }
我这样为什么在HotelList.aspx得不到值!!!!!!那里有错.

------解决方案--------------------
HashTable ht = new Hashtable();
ht.Add("StartDate",this.tbTargetCity.Text);
ht.Add("EndDate",this.tbTargetCity.Text);
ht.Add("CityCode",this.tbTargetCity.Text);
ht.Add("HotelName",this.tbHotelName.Text);
Session["info"] = ht;
Response.Redirect("HotelList.aspx");




In HotelList.aspx page:
Hashtable ht = (Hashtable)Session["info"]
string StartDate = ht["StartDate"].ToString(); 
string EndDate = ht["EndDate"].ToString(); 
string CityCode = ht["CityCode"].ToString(); 
string HotelName = ht["HotelName"].ToString(); 




------解决方案--------------------
探讨
你需要在HotelList.aspx页面获取Request.QueryString["参数名"]