开发者

Have you used ASP.NET MVC with jQuery's AJAX to power your navigation?

I've used jQuery's AJAX on a webforms app (kill me), but it worked fairly well after fighting with the webforms framework for a good while. I had links that would load aspx pages into a content div through jQuery's AJAX functions. One of the biggest issues was dealing with state without using session. I ended up using cookies that were used on the client and server. A major security issue, but the site was internal and not in the cloud so I didn't have to worry about that.

It navigation works great for the user and the speed is amazing, but it obviously isn't the best way to go (using webforms). I'm going to build a MV开发者_JAVA技巧C app with the same navigation scheme. Anybody have any experience doing it a similar way? Any tips or advice?


Generally speaking, if you are loading large amounts of content into your app through AJAX calls, it's not a good thing. The reason for this is that if it is public, then you kill the searchability of your site by sites like Google, Bing, etc, etc.

If you are still on an internal network, then searchability isn't an issue, but it also is sloppy from a URL structure point of view, as it prevents people from bookmarking content that is relevant to them, and doesn't allow you to hone in on specific parts of the site when you want to.

ASP.NET MVC doesn't encourage or discourage this, but what I would recommend if you insist on going this route is to take a look at some of the templating packages available for javascript (you can use jQuery to develop your own if you wish), and return JSON content from your controllers which you would then act on when you call it using jQuery from the client side.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜