## ASP.NET Core MVC Model Binding - ViewData["Title"] ### Overview In ASP.NET Core MVC, ViewData is a dynamic property that provides a way to pass data from the controller to the view. ViewData["Title"] is a specific property that is used to set the title of the page that is rendered by the view. ### Setting the ViewData["Title"] Property The ViewData["Title"] property can be set in the controller action method that returns the view. The following code sample shows how to set the ViewData["Title"] property in the CreateStudent action method of the StudentController: ```csharp public IActionResult CreateStudent() { ViewData["Title"] = "Create Student"; return View(); } ``` ### Using the ViewData["Title"] Property in the View The ViewData["Title"] property can be used in the view to set the title of the page. The following code sample shows how to use the ViewData["Title"] property in the CreateStudent.cshtml view: ```html
Comments