Visual studio C# asp.net

protected void btnEnquire_Click(object sender, EventArgs e)
{
if(txtGameId.Text.Equals("") || !valid()){
lblTest.Text="You should enter the correct game id";
}
else
Response.Redirect("Test.aspx?Game_id='" + txtGameId.Text+"'");
}

protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
{
Response.Redirect("Test.aspx?Game_id=" + GridView1.Rows[GridView1.SelectedIndex].Cells[1].Text);
}
public bool valid() {
int a = Convert.ToInt32(txtGameId.Text);
if (a > 852000 && a < 852003)
return true;
else
return false;

}
我怎样才可以从GridView中拿取Game_id这个数据,我现在是用bool hardcode掉 该怎样改掉呢?

string game_id = Request.QueryString["Game_id"];
温馨提示:答案为网友推荐,仅供参考
第1个回答  2015-07-03
string game_id = Request["Game_id"];
相似回答
大家正在搜