views:

84

answers:

2

How to route url contains # sharp character like this: ~/page.aspx#/Home to be: ~/Home

+3  A: 

The # in a URL refers to a named anchor (<a name="xxx" />) tag and does not get passed through to the server.

~/page.aspx#/Home refers to the anchor named /home on the page page.aspx.

The server will only get the request to page.aspx and anything from the # onwards will not be passed through.

See this SO question and answers.

In other words - do not use the # character in your URL if they do not refer to a named anchor within the document, as you will not be able to get these routed in the server.

Oded
A: 

I think Oded has the right answer here.

But if you happen to have a situation where the # is in user entered data, you should URL escape it before putting it in the URL.

#/Home would then be %23/Home

However, I get the feeling this isn't actually the case here.

David Hogue