Can't get #Param part of mysite/index.aspx#Param

Discussion in 'ASP.NET / ASP.NET Core' started by geminirand, Jun 17, 2007.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. All,

    I thought I could use Request.Url to retrieve the "#Param" part of a url like "mysite/index.aspx#Param", but all I get is "mysite/index.aspx". I mean I was trying to get the whole thing and then parse the string to get it down to "Param".

    Funny thing is what I'm getting is exactly the opposite of what I want. I want to get "Param" because there could be several on the page and I need to know which one, then process things.

    Does anyone know how to do this? I've googled for a while and get nothing, and different version of the Request object get me the same result.

    Thanks.
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    Do you mean you want to retrieve the Get Request string?

    Bruce

    DiscountASP.NET
    www.DiscountASP.NET
     
  3. Something like mysite/index.aspx#Param is used to anchor to a section on your page.

    For example : See : daspstaff00.web120.discountasp.net/default.aspx

    I have the following on my page (at the bottom)
    <div id='Param'>
    Go here Section
    </div>

    The above url will just anchor to the section specified above.Therefore '#' cannot be used to pass parameters and hence 'Request.Url' will not include the # or anything after it.

    Vikram

    DiscountASP.NET
    www.DiscountASP.NET

    Post Edited (vvsharma) : 6/20/2007 2:08:55 AM GMT
     
  4. yeah that's what I was using it for, to anchor to a certain point in the page. The problem is that point in the page is in an AJAX collapsible panel that defaults to collapsed, so I need to expand it if that anchor is in the url (or some other way to get it).

    I can't use a link button and have to stick with an a href.

    That's interesting about the url not returning it because I thought that,if it was in the address bar, it was part of the url.

    If I use a query string I'll be able to tell which part of the page to go to but it won't actually go there unless I post back and redirect with the #param this time, which isn't good...unless having the page in an update panel reduces the page reloading. Hmmm...

    Thanks for the reply.
     
  5. I'm not sure what you mean. I want to get everything in the address bar, though specifically I want the part starting with the # sign. If I can get all of it I can at least parse the string but by default it is not retrieving the part I want.


    Thanks.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page