I've implemented Entity Framework into my project, since I need to insert some data via a form to a custom table in my SQL database.
I've scaffolded all the CRUD views and have a button that links to the create view. This all works well and fine, but I need the create view to use the Master template that contains my header, navigation and footer.
In my create view I need to import my model, but I am unable to both use the @model and the @inherit keywords in the same file, so I am unable to inherit the master template.
Is it not possible to use Entity Framework with Umbraco? Do I need to create a partial view or Macro?
Alex's explination is correct, you would use @inherits UmbracoViewPage
Both of Umbraco base view pages (UmbracoViewPage and UmbracoTemplatePage) allow you to specify the model, although the UmbracoTemplatePage insists that your model inherits from Umbracos RenderModel object.
Can't use @model with @inherit
I've implemented Entity Framework into my project, since I need to insert some data via a form to a custom table in my SQL database.
I've scaffolded all the CRUD views and have a button that links to the create view. This all works well and fine, but I need the create view to use the Master template that contains my header, navigation and footer.
In my create view I need to import my model, but I am unable to both use the @model and the @inherit keywords in the same file, so I am unable to inherit the master template.
Is it not possible to use Entity Framework with Umbraco? Do I need to create a partial view or Macro?
Hi thomas
You can use Entity Framework with Umbraco, you can use what you want with Umbraco :)
There is a PetaPOCO mini ORM in Umbraco, often it's enough.
Thanks,
Alex
Thanks, but where would i place my markup for the Create view to make it inherit from my master template?
I cannot use @model and @inherit in the same file.
But you can use:
Hi Thomas,
Alex's explination is correct, you would use @inherits UmbracoViewPage
Both of Umbraco base view pages (UmbracoViewPage and UmbracoTemplatePage) allow you to specify the model, although the UmbracoTemplatePage insists that your model inherits from Umbracos RenderModel object.
Thanks,
Nik
'''@inherits UmbracoViewPage
is working on a reply...