First time at GK Digital?

GK Digital is an online, collaborative learning platform built from the ground up to be a superior learning experience on the web. It is self-paced and supported by instructors and peers. GK Digital is professional training in the 21st century, from Global Knowledge.
Task: Create views in MVC (Razor and C#)

The razor view engine, which first appeared in ASP.NET MVC 3, is massive step forward for web technologies and has become the defacto standard for MVC. Many templating engines (WebForms/ASPX, Python, etc) put the burden on the programmer to to separate code and markup.

Razor is different. It puts the burden on the tooling and allows for smooth and simple transitions with minimal fuss. For example, we could output the time using the following razor syntax:

<span>Welcome, the time is @DateTime.Now.ToShortTimeString()!</span>

And the output would be something like:

Welcome, the time is 12:24 PM!

Being fluent in Razor syntax is a basic requirement of being an MVC developer. That's what this task is all about!

Before you get started, keep in mind that this is only the beginning for Razor. We will cover composite / partial views, layouts, sections, etc. in subsequent tasks. Let's get to it!

System.InvalidOperationException: The model item passed into the dictionary is of type 'LearningLine.Interface.ICourse[]', but this dictionary requires a model item of type 'LearningLine.Mongo.Course[]'. at System.Web.Mvc.ViewDataDictionary`1.SetModel(Object value) at System.Web.Mvc.ViewDataDictionary..ctor(ViewDataDictionary dictionary) at System.Web.Mvc.WebViewPage`1.SetViewData(ViewDataDictionary viewData) at RazorGenerator.Mvc.PrecompiledMvcView.Render(ViewContext viewContext, TextWriter writer) at System.Web.Mvc.HtmlHelper.RenderPartialInternal(String partialViewName, ViewDataDictionary viewData, Object model, TextWriter writer, ViewEngineCollection viewEngineCollection) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model, ViewDataDictionary viewData) at System.Web.Mvc.Html.PartialExtensions.Partial(HtmlHelper htmlHelper, String partialViewName, Object model) at ASP._Views_Tasks_ShowPublic_cshtml.Execute()

Preview any course on GK Digital for free.

Just choose a course from our catalog and then press preview course for free.