Bug tracker: Create the ProjectMaster view
The ProjectMaster view displays the list of available projects. The view is represented by a Razor web page. To create the view:
- In Visual Studio, navigate to the Areas BugTracker Views Project folder and create a new file with the
cshtmlextension.
Name the classProjectMaster. - Add
usingstatements to the following namespaces:Telerik.Sitefinity.ModelTelerik.Sitefinity.DynamicModules.Model
- Define the type of the
Modelproperty.
Use the same type as the type of the data that you passed as themodelargument to theViewmethod in the project controller. - Create an HTML entry for each of the projects in the query:
- Create an unordered list element.
- Inside the tag of the list, use
foreachand create a list item element for each project. - As content of the list item element, create a hyperlink by using the
ActionLinkmethod.
This link must navigate to the view containing the list of bugs for the project. - Pass the
Titleof the project as thelinkTextargument. - Pass
Indexas theactionNameargument. - Pass
Bugas thecontrollerNameargument. - Create an anonymous type containing the ID parameter and pass it as the
routeValuesargument. - As the
htmlAttributesargument passnull.
The generated URL will look similar to this one:http://localhost/Bug/Index/EAC1A302-76E3-4E0E-B314-B56CB76E6562. This means that theIndexaction in theBugControllerclass will be executed and the route values will contain the ID of the respective project.
GITHUB EXAMPLE: For more information about the content of the file, see the ProjectMaster.cshtml file of the downloaded sample project.
Want to learn more?
Enhance your Sitefinity skills by enrolling in free training sessions. Become Sitefinity certified through Progress Education Community to strengthen your professional credentials.
Get started with Integration Hub | Sitefinity Cloud
This free lesson teaches administrators, marketers, and other business professionals how to use Sitefinity Integration Hub to create automated workflows between Sitefinity and other business systems.
Web Security for Sitefinity Administrators
This free lesson teaches administrators the basics about protecting your Sitefinity instance and your sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.
Foundations of Sitefinity ASP.NET Core Development
The free on-demand video course teaches developers how to use Sitefinity ASP.NET Core and take advantage of its decoupled architecture and modern development model.