Is there an MVC way of doing ASCX?
Asked Answered
D

3

7

Are ASCXs still used in ASP.NET MVC or should we be using something else?

Dowski answered 25/9, 2009 at 0:27 Comment(0)
M
5

Yes, you can still use .ascx. They are often referred to as partial views.

Mardis answered 25/9, 2009 at 0:33 Comment(0)
I
3

You bet, I typically use an ascx to render a partial view for some type of ajax functionality. Although, as Jeffrey Palermo points out they don't add much value beyond the extension being a direct inclination that your are working with a partial view.

Involutional answered 25/9, 2009 at 0:35 Comment(0)
B
3

The great thing about them is that in your controller you can then use

return PartialView("MyPartialView", items);

This works great in a jQuery call when you are only interested in changing the contents of particular part of the page and not the whole page.

Balladmonger answered 25/9, 2009 at 3:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.