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. Advertising

  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. Advertising

  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. Advertising

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:
    3,775
    dave wanta
    Jul 4, 2003
  2. George
    Replies:
    5
    Views:
    6,677
    George
    Apr 2, 2004
  3. michaaal
    Replies:
    6
    Views:
    437
    Michael D. Kersey
    Jul 15, 2003
  4. John Davis
    Replies:
    2
    Views:
    426
    Dave Anderson
    Aug 18, 2003
  5. Ivan
    Replies:
    5
    Views:
    170
Loading...

Share This Page