0

I have a page which has 5 tabs. I need to load values in all the three tabs when i click on search in the main page. The three tabs has content from 3 partial views. I mean to say how can I update all the three partial views from the search controller action.

Regards, Amit Agarwal

1
  • Do you want to load with ajax or submit? Commented May 19, 2013 at 20:03

1 Answer 1

1

I never went to school and only learned how to program a short time ago but I think what might help you is to use a control structure to "update" the models of the 3 partial views, then incorporating those models in the partial views.

I think there is a lot of different ways you can do this, I just hope my example is logical as it is probably not industry standard or anything like that.

Partial View Controller section

Logic search controller action preformed or not?

If preformed do this stuff. - $partial_model1 = the appropriate model

$partial_model2 = the appropriate model

$partial_model3 = the appropriate model

else do other stuff, for example set default partial models for partial views.

End Logic search controller action preformed or not? End Partial View Controller section

Tab# Controller section

Tab1 $tab1_model = the appropriate model for Tab1 Load Tab view 1 inside Tab view 1 incorporate $tab1_model, load Partial view 1 incorporate $partial_model1, Load Partial view 2 incorporate $partial_model2, Load Partial view 3 incorporate $partial_model3

Tab2 $tab2_model = the appropriate model for Tab2 Load Tab view 2 inside Tab view 2 incorporate $tab2_model, load Partial view 1 incorporate $partial_model1, Load Partial view 2 incorporate $partial_model2, Load Partial view 3 incorporate $partial_model3

Tab3 $tab3_model = the appropriate model for Tab3 Load Tab view 3 inside Tab view 3 incorporate $tab3_model, load Partial view 1 incorporate $partial_model1, Load Partial view 2 incorporate $partial_model2, Load Partial view 3 incorporate $partial_model3

Tab4 $tab4_model = the appropriate model for Tab4 Load Tab view 4

Tab5 $tab5_model = the appropriate model for Tab5 Load Tab view 5 End Tab# Controller Section

I could have loaded the views in the controller section instead but by the use of your term "partial views" I feel you might want to embed those "partial views" within your Tab# views.

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

Comments

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.