How to read Hash Parameters in Url [duplicate]

2019-09-18 02:23发布

Possible Duplicate:
How to get Url Hash (#) from server side

I have hash parameters in url

Can any body please help me to how to read Hash parameters value from Url using C#?

www.example.com/default.aspx#!type=1

How to read value of type?

标签: c# url
2条回答
甜甜的少女心
2楼-- · 2019-09-18 02:54

The hash part is only used and available on the client. You cannot read it from ASP.NET / C#.

查看更多
趁早两清
3楼-- · 2019-09-18 03:06
  1. Split the URL at the hash (#).
  2. Then split the second element from above at each ampersand (&)
  3. Then split each of those at the equals (=) sign.

You will then have all the parameters and values.


If this was asking about a ASP.net application, you want to use Request.QueryString["type"] to get the value.

查看更多
登录 后发表回答