Unable to resolve relative Url containing colon(:) using resolve url
I'm facing a strange bug.
Page.ResolveUrl("~/myPage.aspx?param=valueA:valueZ");
And it just not work, visibly cause of the ':'.
When I mean does not work I mean on a site like this:
http://myMachine/myVir开发者_StackOverflowtual/default.aspx
If I click on a link containig the code before, i get:
http://mymachine/MyVirtual/~/myPage.aspx?param=valueA:valueZ
Anyone knows how to make it works ?
thx
Replace your ':' with '%3A', not sure if this is the only fix but it is the first thing that jumps out at me.
This is because the : character is a reserved character. For more info on reserved characters you can take a look at this site
It's because the :
character is reserved. You need to encode it as %3A
...
For multiple value passing, use this: ASP QueryString Collection
精彩评论