请教高手指教很简单的问题 我迷惑了
请各位老师请帮我看看 我这段程序错在哪里啊
我将在第一个页面选择或则填写的内容传到第二个页面,但是有很多内容需要传递
我这个写的
Response.Redirect( "http://localhost/sycar/cn/find2.aspx?type= ' "+ddl1.SelectedItem.Text.ToString()+ " '&name= ' "+tbname.Text.ToString()+ " '&price= ' "+ddl3.SelectedItem.Text.ToString()+ " '&year= ' "+ ddlyear.SelectedItem.Text.ToString()+ " '&month= ' "+ddlmonth.SelectedItem.Text.ToString()+ " '&day= ' "+ddlday.SelectedItem.Text.ToString()+ " '&area= ' "+ddl5.SelectedItem.Text.ToString()+ " '&dang= ' "+ddl6.SelectedItem.Text.ToString()+ " '&oil= ' "+ddl7.SelectedItem.Text.ToString()+ " ' ");
第二个页面是这样写的
string type1=Page.Request.QueryString[ "type "].ToString().Trim();
string name1=Page.Request.QueryString[ "name "].ToString().Trim();
string price1=Page.Request.QueryString[ "price "].ToString().Trim();
string year1=Page.Request.QueryString[ "year "].ToString().Trim();
string month1=Page.Request.QueryString[ "month "].ToString().Trim();
string day1=Page.Request.QueryString[ "day "].ToString().Trim();
string area1=Page.Request.QueryString[ "area "].ToString().Trim();
string dang1=Page.Request.QueryString[ "dang "].ToString().Trim();
string oil1=Page.Request.QueryString[ "oil "].ToString().Trim();
strSql= "select * from zcar where 1=1 ";
if(type1!= " ")
{
strSql += " and type= ' "+type1+ " ' ";
}
if(name1!= " ")
{
strSql += " and name= ' "+name1+ " ' ";
}
if(price1!= " ")
{
strSql += " and price= ' "+price1+ " ' ";
}
if(year1!= " ")
{
strSql += " and yizumoyear < ' "+year1+ " ' ";
}
if(month1!= " ")
{
strSql += " and yizumomonth < ' "+month1+ " ' ";
}
if(day1!= " ")
{
strSql += " and yizumoday < ' "+day1+ " ' ";
}
if(area1!= " ")
{
strSql += " and suozaidi= ' "+area1+ " ' ";
}
if(dang1!= " ")
{
strSql += " and chedang= ' "+dang1+ " ' ";
}
if(oil1!= " ")
{
strSql += " and ranyou= ' "+oil1+ " ' ";
}
但是运行的时候 当我在第一个页面选择了一个内容时候 老是在第二个页面抱错说 我选择的内容附近有语法错误
------解决方案--------------------Response.Redirect( "http://localhost/sycar/cn/find2.aspx?type= ' "+ddl1.SelectedItem.Text.ToString()+ " '&name= ' "+tbname.Text.ToString()+ " '&price= ' "+ddl3.SelectedItem.Text.ToString()+ " '&year= ' "+ ddlyear.SelectedItem.Text.ToString()+ " '&month= ' "+ddlmonth.SelectedItem.Text.ToString()+ " '&day= ' "+ddlday.SelectedItem.Text.ToString()+ " '&area= ' "+ddl5.SelectedItem.Text.ToString()+ " '&dang= ' "+ddl6.SelectedItem.Text.ToString()+ " '&oil= ' "+ddl7.SelectedItem.Text.ToString()+ " ' ");