Request.QueryString problem

Discussion in 'ASP .Net' started by =?Utf-8?B?UGF1bA==?=, Jan 12, 2006.

  1. I am creating a asp.net web page on c#. When call the url which is my web
    project... http://localhost/webapp/testpage.aspx?test=1234#item

    On the load of the page testpage.aspx I have code...
    Request.QueryString["test"]

    This returns 1234`

    Why does is stop at the #? How do I make is work so that the value 1234#item
    is returned?
     
    =?Utf-8?B?UGF1bA==?=, Jan 12, 2006
    #1
    1. Advertisements

  2. =?Utf-8?B?UGF1bA==?=

    mortb Guest

    I can't see why this will not work for you. I've done this a lot of times
    using ; instead of # as separator
    My best bet is changing the # character in your qs.

    /mortb

    "Paul" <> wrote in message
    news:...
    >I am creating a asp.net web page on c#. When call the url which is my web
    > project... http://localhost/webapp/testpage.aspx?test=1234#item
    >
    > On the load of the page testpage.aspx I have code...
    > Request.QueryString["test"]
    >
    > This returns 1234`
    >
    > Why does is stop at the #? How do I make is work so that the value
    > 1234#item
    > is returned?
    >
     
    mortb, Jan 12, 2006
    #2
    1. Advertisements

  3. =?Utf-8?B?UGF1bA==?=

    john smith Guest

    Paul wrote:
    > I am creating a asp.net web page on c#. When call the url which is my web
    > project... http://localhost/webapp/testpage.aspx?test=1234#item
    >
    > On the load of the page testpage.aspx I have code...
    > Request.QueryString["test"]
    >
    > This returns 1234`
    >
    > Why does is stop at the #? How do I make is work so that the value 1234#item
    > is returned?
    >

    That's normal behavior - it's not an ASP.Net specific problem or
    anything. The # sign is used as a delimiter in the URI to separate the
    page fragment identifier (i.e. anchor). There is a RFC about this.
    You'll have to URLEncode it first (i.e. %23). Same for other reserved
    characters.
     
    john smith, Jan 12, 2006
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Daniel Bass
    Replies:
    2
    Views:
    4,139
    dave wanta
    Jul 4, 2003
  2. Brian Birtle
    Replies:
    2
    Views:
    2,602
    John Saunders
    Oct 16, 2003
  3. George
    Replies:
    5
    Views:
    6,926
    George
    Apr 2, 2004
  4. Mehdi
    Replies:
    6
    Views:
    36,753
    sloan
    Apr 6, 2006
  5. michaaal
    Replies:
    6
    Views:
    591
    Michael D. Kersey
    Jul 15, 2003
  6. John Davis
    Replies:
    2
    Views:
    601
    Dave Anderson
    Aug 18, 2003
  7. Ivan
    Replies:
    5
    Views:
    338
  8. Adeel Ahmad
    Replies:
    1
    Views:
    784
    Anthony Jones
    Mar 7, 2006
Loading...