开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜