whosrdaddy
Vendor
I have this problem:
I have an MVC site with spark viewengine and I want to achieve this:
masterpage (Application.spark) must show the name of the logged in user.
content pages will show other data.
As I understand it, I can't have different models for viewdata. So masterpage uses viewdata of type UserDTO and for example my index() view uses viewdata of type UserListViewModel.
the way I'm solving it at the moment is using spark content blocks and pass in the user data in each viewmodel.
So my UserListViewModel has a property currentUser which is in turn a UserDTO. This means I have to fill in this content block for EACH view and pass in the data (aka Model.currentUser.Fullname).
And each viewmodel needs to have a currentUser property.
Is there another way to achieve this, or am I missing something?
Cheers,
Daddy
-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
I have an MVC site with spark viewengine and I want to achieve this:
masterpage (Application.spark) must show the name of the logged in user.
content pages will show other data.
As I understand it, I can't have different models for viewdata. So masterpage uses viewdata of type UserDTO and for example my index() view uses viewdata of type UserListViewModel.
the way I'm solving it at the moment is using spark content blocks and pass in the user data in each viewmodel.
So my UserListViewModel has a property currentUser which is in turn a UserDTO. This means I have to fill in this content block for EACH view and pass in the data (aka Model.currentUser.Fullname).
And each viewmodel needs to have a currentUser property.
Is there another way to achieve this, or am I missing something?
Cheers,
Daddy
-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!