-
Notifications
You must be signed in to change notification settings - Fork 2
Implementation
Note: All ESDC internal web pages MUST use the ESDC sub theme.
When adding new pages to your project, these pages will need to inherit the "GoC.WebTemplate.BasePage" provided in the Web Template package. The BasePage provides the functionality for the language toggle.
- Add a new page:
- From your project, click "Add/New Item";
- Select "Web Form with Master Page";
- Navigate and select one of the master pages under "GoC.WebTemplate";
- Click "OK".
- Inherit the BasePage of the Web Template:
- In the code behind of the newly added page, change the inheritance from "System.Web.UI.Page" to "GoC.WebTemplate.BasePage".
For the Views ensure you are using one of the provided Layout files that have been added to ~\Views\GoC.WebTemplate\
For the Controller there are 2 implementation options:
- Use
GoC.WebTemplate.MVC.WebTemplateBaseController
to inherit your controller. - Use
GoC.WebTemplate.MVC.ActionFilters.WebTemplateActionFilterAttribute
by: (Coming Next Release)You can then access the WebTemplateModel by using the extention[WebTemplateActionFilter] public sealed class TestActionFilterController : Controller
ViewData.GetWebTemplateModel();
inside a View Action
CoreMVC has some manual installation steps, make sure you have done all the additional CoreMVC installation steps.
For the Views ensure you are using one of the provided Layout files that can be referenced by ~\Views\GoC.WebTemplate\
For the Controller there are 2 implementation options:
-
Use
GoC.WebTemplate.CoreMVC.WebTemplateBaseController
to inherit your controller. Set your controller's constructor to have theModelAccessor
injected and passed to the inherited base controller:public TestLayoutsController(GoC.WebTemplate.Components.Core.Services.IModelAccessor modelAccessor) : base(modelAccessor) { }
-
Use
GoC.WebTemplate.CoreMVC.ActionFilters.WebTemplateActionFilterAttribute
by: (Coming Next Release)[WebTemplateActionFilter] public sealed class TestActionFilterController : Controller
You can then access the WebTemplateModel by using the extention
ViewData.GetWebTemplateModel();
inside a View Action
The web template does manage the language toggle and stores the users language in session. It can be retrieved with the following key GoC.Template.Culture
; You can leverage the built in language features of the Web Template or execute your own logic.
The web template can be adapted to suit your needs, please review the configurations and properties of the template.