-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow Views with Models #19
Comments
Just assign your model to this.ViewData and your view will find it as Sent from my iPhone S M Sohan On 2011-06-24, at 5:21 PM, Korayem
|
Doh!!! So it should be as simple as Never knew that. Thought I had to pass it as a parameter! I suggest you add this small tip to your wiki post for the ignorant folks like me :) Sorry for the trouble and a million thanks for the quick response |
:) Sent from my iPhone S M Sohan On 2011-06-24, at 11:11 PM, Korayem
|
;) 👍 |
You may not consider this an "issue" but seeing how MvcMailer is all about MVC, i think not having a model in the view is an "issue". Relying on Viewbag is cool, but why not really follow the MVC pattern?
Would love to have my razor views setup a model type so that I can pass the model into the view using PopulateBody();
This should be possible:
var model = new ModelView(); model.FirstName = "Hello"; model.LastName = "World"; PopulateBody(mailMessage, "RazorView", model);
so that in RazorView.cshtml
@model MyModelView This is a @Model.FirstName @Model.LastName app!
The text was updated successfully, but these errors were encountered: