3

What's the best way to provide shared data to my views?

For example, I want to be able to just put <%= Model.Title %> in my master page, or something similar.

In that scenario, is it better to override the ViewPage classes I need? Or just use a shared model object?

I'm currently trying to do the shared model object approach -- it works; just a lot of code and view pages to edit...

2
  • 1
    Maybe stackoverflow.com/questions/976493/… would be interesting to you Commented Jul 21, 2009 at 18:51
  • Thanks eu-ge-ne, that's a more sensible solution! :) Commented Jul 21, 2009 at 22:28

1 Answer 1

1

You can put ContentPlaceHolder on your MasterPage and in views place shared data into it

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.