Retrieve GET variables from URL in ASPX

前端 未结 3 810
抹茶落季
抹茶落季 2020-11-30 11:11

What\'s the easiest / standard way to retrieve the GET (in URL) variables passed to a .aspx (VB) page?

3条回答
  •  春和景丽
    2020-11-30 11:25

    You can use the following:

    Example URL: http://www.whatever.com?hello=goodbye&goodbye=hello

    string value = Request.QueryString("hello");
    

    Value will be goodbye

    or

    foreach(string key in Request.QueryString)
    {
        Response.write(Request.QueryString(key))
    }
    

提交回复
热议问题