D
D
David Sedrakyan2016-07-02 02:28:07
ASP.NET
David Sedrakyan, 2016-07-02 02:28:07

Why doesn't my MVC version match the examples?

The question is this, in all MVC educational material Code examples don't match the templates in my VS.
Here is one example, tell the problem which version I need to make these examples work.
CODE from examples Home controller, default project, mvc 4

Класс HomeController
using System.Web.Mvc;
namespace Guestbook.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start";
return View();
}
public ActionResult About()
{
ViewBag.Message = "Your quintessential. . . ";
return View();
}
}

and here is from my template
Public Class HomeController
    Inherits System.Web.Mvc.Controller

    Function Index() As ActionResult
        ViewData("Message") = "Modify this template to jump-start your ASP.NET MVC application."

        Return View()
    End Function

    Function About() As ActionResult
        ViewData("Message") = "Your app description page."

        Return View()
    End Function

    Function Contact() As ActionResult
        ViewData("Message") = "Your contact page."

        Return View()
    End Function
End Class

My version of visual studio express 2013

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rou1997, 2016-07-02
@PrimeSedrakyan

The languages ​​are different, C# is on top, and you have VB.NET (basic), create a C# project.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question