Skip to content
Advertisement

Tab view active and inactive with model value

I just want to know in my ASP.NET MVC application I just created a tab view.

For the View I pass some data from the controller.

So I need to active and inactive tab according to the value.

like an example.

JavaScript

Then I need to show tab one active and others, inactive. ( active tab with Green color and Gray color like to know)

This is the tab view

JavaScript

Do I need to use Javascript for this operation? If yes any example will be helpful.

Advertisement

Answer

As remarked in my comment: you can have fully-interactive and animated tabs to switch content-display without needing any JavaScript at all.

The @model.CurrentId value is used to set the initially-visible tab content (by setting checked="checked" on the hidden trigger radio inputs)

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement