开发者

Ajax #anchors processing with MVC

I am looking to standardize the processing of ajax #anchors at the server side, using MVC.

Before a controller action is invoked I want to convert every request with ajax anchors into a 开发者_StackOverflowrequest without ajax anchors, so that the controller code does not know there were anchors in the request:

For example:

1) /user/profile#user/photos should be treated as /user/photos

2) /main/index#user/profile/33 should be treated as /user/profile/33

What is the best technique in MVC to accomplish that?


Anchors are not pushed to the server with the url. One option would be to put the value /main/index#user/profile/33 inside a hidden field and get the contents of this from your controller.

However I am not sure how you are using the anchors within the markup page so this may not help!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜