3

I am developing a web application in ASP.NET MVC3 with C# and Razor. I need to create tabs within my web page, exactly as it is displayed in browsers.

I don't know if there is already a template made available by MVC3 or creating tabs is an easier task than I think. Actually it is the first time ever I've been asked to do it.

Anybody has some advice or suggestion? At the beginning I plan to do it with postbacks in order not to lose too much time with jQuery or other client technologies. Thank you very much :D

4
  • 1
    jQuery is very much part of the MVC3 ecosystem. You'll benefit from learning it! Commented Feb 9, 2012 at 16:36
  • 1
    Embrace the jquery! And if I am not mistaken, in MVC there is no such thing as a postback, at least semantically. You click on links (request) and something happens (response) which may include going to the same page you're on currently. Statelessness is our friend. Commented Feb 9, 2012 at 16:40
  • @MrBoJangles Exactly. MVC is all around low-level GETs and POSTs. Commented Feb 9, 2012 at 16:56
  • thanks for your comments, maybe I misused postbacks, what I meant was to send back the request to the server synchronously without using any AJAX-based technique. I love jQuery as well but first of all I need to show functionality to the users and than the last step is to adopt client based technologies to improve users'experience Commented Feb 10, 2012 at 9:55

2 Answers 2

8

In my opinion, the time you'd "lose" from learning jQuery (depending on your familiarity with JavaScript/jQuery) would be well worth the time you'd spend on having to play around with the HTML and CSS to get decent looking tabs.

The jQuery UI Tabs are easy to set up, and very responsive and nice to look at.

Sign up to request clarification or add additional context in comments.

1 Comment

I thougth jQuery was the most complex solution but as far as I can see it is the only feasible option. Thanks for your answer!
2

The default templates from MVC have a simple tab system in place for navigation that is based on simple css.

You should have a look at those. I know that you said that you wanted to avoid jQuery for this, but they don't have a significant learning curve and there are hundreds of examples of their use on the web.

http://jqueryui.com/demos/tabs/ in conjunction with PartialViewResults and jquery ajax can be a powerful tool.
ASP.NET MVC 2 loading partial view using jQuery - no client side validation

1 Comment

Tabs? That's more like navigation buttons. I don't know if that'd qualify as "tabs", persay.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.