What is the difference between ascx and .cshtml?

I have this in my index.cshtml:

@{ ViewBag.Title = "Home Page"; } @{ Html.RenderPartial("~/Views/Home/Test.cshtml"); } 

and this is in my controller:

  [ChildActionOnly] public ActionResult Test() { return View(); } 

I can’t understand what is the fundamental difference between using .ascx and .cshtml in the RenderPartial method? Both work for me. What's the difference? Can someone explain?

+6
source share
1 answer

There are two different viewing mechanisms that you can use for asp.net mvc3 web applications. Razor (.cshtml) and ASPX (* .aspx / *. Ascx).

Take a look at this post about their differences:

What is the difference between Razor and ASPX?

+5
source

Source: https://habr.com/ru/post/896861/


All Articles