locked
url extract query string RRS feed

Answers

  • User-1980594115 posted

    You can use this:

    int cid = 0;
    if(!Request.QueryString["cid"].IsEmpty() && Request.QueryString["cid"].IsInt()) 
    { 
    	cid = Request.QueryString["cid"].AsInt(); 
    } 
    

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 18, 2015 11:27 AM

All replies

  • User1577371250 posted

    Hi,

    try

    string cid = Request.QueryString["cid"].ToString();

    Wednesday, March 18, 2015 7:39 AM
  • User-1965857832 posted

    Try this

    Uri myUri = new Uri("http://www.test.com/pagename?cid=1");
    string param1 = HttpUtility.ParseQueryString(myUri.Query).Get("cid");

    Wednesday, March 18, 2015 7:39 AM
  • User1576270086 posted

    Hi,

    try bellow code

    if(Request.QueryString["cid"] != null)

    {

              string CID = Request.QueryString["cid"].ToString();

    }

    Wednesday, March 18, 2015 7:44 AM
  • User1508394307 posted

    how to extract cid=1

    Request.QueryString.ToString();

    See similar thread: http://forums.asp.net/t/1423411.aspx?How+to+get+full+QueryString 

    Wednesday, March 18, 2015 7:45 AM
  • User-1980594115 posted

    You can use this:

    int cid = 0;
    if(!Request.QueryString["cid"].IsEmpty() && Request.QueryString["cid"].IsInt()) 
    { 
    	cid = Request.QueryString["cid"].AsInt(); 
    } 
    

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 18, 2015 11:27 AM