Server.Transfer 在用户控件中好像又不能用
用这个又不会怎么接收参数???
private void bntQuery_Click(object sender, System.EventArgs e)
{
string strTerm = dlistTerm.SelectedValue.ToString();
string strType = dlistType.SelectedValue.ToString();
string strSearch = txtSearch.Text;ASCIIEncoding encoding=new ASCIIEncoding();
string postData="myTerm="+strTerm;
postData += ("&myType="+strType);
postData += ("&mySearch="+strSearch);
byte[]  data = encoding.GetBytes(postData);
HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create("http://localhost/shop/query.aspx");
myRequest.Method = "POST";
myRequest.ContentType="application/x-www-form-urlencoded";
myRequest.ContentLength = data.Length;
Stream newStream=myRequest.GetRequestStream();
newStream.Write(data,0,data.Length);
newStream.Close();
HttpWebResponse res = (HttpWebResponse) myRequest.GetResponse();
Encoding enc = System.Text.Encoding.GetEncoding("GB2312");
StreamReader sr = new StreamReader(res.GetResponseStream(),enc);
string sHtml = sr.ReadToEnd();
sr.Close();
res.Close();
Response.Redirect("query.aspx");
}