Using ASPX View Engine with MVC 5 - asp.net-mvc

Is it possible to use ASPX view engine with MVC 5?
We have a product using MVC 4 on ASPX view engine and we want to migrate to MVC 5, however, when I create a new project in VS 2013, select MVC and try to add a new View, I don't see any option to add a view using ASPX View Engine. Has Microsoft stopped with ASPX View Engine? Is there any way to still use ASPX?

This is what a blog post regarding the release of VS2013 said: "The HTML editor used by Razor files (.cshtml and .vbhtml) as well as normal HTML files has been replaced with entirely new code. Web Forms (.aspx and .ascx) involve significantly more complexity and did not fit into a well-polished release for Visual Studio 2013, so they will be updated in an upcoming product release. " Source:http://blogs.msdn.com/b/webdev/archive/2013/06/27/html-editing-features-in-visual-studio-2013-preview.aspx

It's installed by default. just check out the ViewEngines.Engines collection. Its output are:
System.Web.Mvc.WebFormViewEngine
System.Web.Mvc.RazorViewEngine

Related

MVC empty WebSite project based on aspx pages

In Visual Studio we have a two ways that create the web projects.
I create the "WebSite" project, empty-project (like: File -> New -> WebSite... and so on).
After that, when the WebSite created I want to make it to MVC WebSite with ASPX, and not Razor pages.
[I decide create the MVC WebSite not Project Site, with this way, because the Visual Studio doesn't provide us WebSite with MVC template based aspx pages].
After creating some pages I want to create and integrate any Razor page.
Describe for question:
IF I attempt use in the Razor view page - " #model MyWebSite " it does not discovering, and I can't use with the ViewBag property later
Question:
What Can I do ?
What NuGet packeg I need install or what dll recourse I need adding to Bin folder of project.
Yes, you can use Razor with an existing ASP.NET WebSite. Simply open your website using the WebMatrix tool and start adding CSHTML files. One caveat is that if your website is using WebForms controls the WebMatrix tool will not provide any help working with them in existing aspx pages. Additionally, Razor does not support WebForms so you will not be able to add something like to a CSHTML file.

ASP.NET MVC template with webgrid instead of table

Is there a Asp.net MVC View Template that uses WebGrid instead of a <table> ?
I should recommend you to set up a T4 template that generates the code that you want for your MVC View Template. Its pretty easy, have a look at this guide and you should get up and going... http://msdn.microsoft.com/en-us/magazine/ee291528.aspx
Microsoft Visual Studio includes a code generation engine known as T4
(which is short for Text Template Transformation Toolkit). You’ve
probably already used T4 templates in Visual Studio without even
knowing they were working behind the scenes.

How to create an ASP.net MVC Project with aspx engine as default

I am trying to create a new project for ASP.net MVC application (2.0) in MS Visual Studio 2008.
It is creating application with Razor as default view engine. It is not asking for choosing view engine, it is just asking whether the test project is required or not
Please help me on this
MVC 2.0 doesn't have razor engine. Razor engine only exist only in mvc3 on wards
however on switching view engines this topic might help you
http://dotnet.dzone.com/news/switching-aspx-razor-view

SinglePageApplication - match sample videos from 2012 Fall update

I am trying to recreate the ASP.NET Single Page application as demonstrated by Steven Sanderson
Single Page Applications - for desktop, mobile, tablet with ASP.NET MVC4
I have downloaded and installed the Build Preview - http://www.asp.net/vnext
I have using NuGet, tried to update my SPA Scaffolding to ASP.NET SPA MVC 4 (Beta)
I am running Visual Studio 2012
When i create a new MVC4 application, there are some distinctive differences between what i have and the demo's i see.
Primarily, after create a new project, if you view what you have the sites look completely difference
What Steve Sanderson Gets
What I Get
Then continuing to follow his example, he created a controller and has an option of
Single Page Application with read/write actions and views, using Entity Framework
This is not avaiable in my Create Controller Dialog
What Steve Sanderson Gets
What I Get
Why are my options differen't?
What have I not installed?
Thanks for any help
The new SPA template is a completely different template, as you have discovered. Short story ... the new template is revised to be a starting place, the old template was deemed too prescriptive.
The new template is a preview and will have more changes by the time it is released. The idea is you can use it as a starting point for a SPA and then add features and other libraries as needed.
UPDATE: If you want more info on what's in the latest template you can read my post here: http://www.johnpapa.net/insidespatemplate

Side-by-Side Asp.Net and MVC Razor

We have an existing ASP.Net Web Application. I would like to create an ASP.Net MVC Razor Application where the two applications will work together. A single Master Page would contain menu items that can call .aspx pages as well as Razor .cshtml pages.
I have seen an example using MvcContrib Portable areas utilizing Routing. This particular example has .aspx pages in both (the MVC was not Razor).
Is there an example out there that will show the two running side-by-side and the MVC is Razor? It would be best if I could download a visual Studio Solution so that I can run this.
I am not sure if the MvcContrib way is the latest and best way to achieve this.
I do not want to go Hybrid!
You don't need any other external librarry. You can always convert the existing ASP.NET web forms Project to be a Hybrid one which uses webforms and MVC. You need to add the required MVC assembly references and make some changes to the web.config and you are all set. Scott has a simple and awesome blog post about this where he explains how to do the conversion.
I scribbled a note about how to enable the MVC specific Context menu( Add Controller / Add View) in the hybrid project after conversion here

Resources