In ASP.NET are Web Pages the new "Classic ASP"? - asp.net

In ASP.NET we have 3 technologies to choose:
Web Forms
MVC
Web Pages
Both Web Forms and MVC represent steps forward in web development.
However Web Pages goes back to the mix of HTML and code (cshtml/vbhtml files) just like classic ASP (HTML + VB).
Being the separation of HTML and code the workhorse of ASP.NET, can we consider Web Pages a step behind?
Thank you

Related

Redirect Asp.net Web form to Mvc View vise vars

I am working on project in that some pages are in Web Form (Asp.net) and some pages are in MVC (Asp.net MVC view)
I want to navigate Web From to Mvc View & vise versa
Project Structure
I want to redirect Asp.net Master page to Mvc Controller
Redirection coder is bellow,
It will not working ,How can I achieve this functionality
I guess you are trying to write razor view syntax in webforms which is not going to work.
You can combine both webforms and MVC in a single project.
Redirect to Webform
in your MVC view to redirect to webforms.
and
Redirect Now
from webfroms to MVC

combine classic asp with asp.net

I have a (huge) website written in classic asp. Now do I have to switch to vb.net (razor). Is there a way to combine those 2 till the switch is complete ?
Is there a way to let the application work with classic asp and vb.net ?
(I use webmatrix)(don't know if this is important information)
The reason I ask this is because the website contains more than
MSDN says you can run .asp and .aspx on the same server
ASP and ASP.NET can both be used on the same Web server. That is, a
Web site or Web application within a site can contain both ASP.NET
pages and ASP pages. Because both ASP and ASP.NET pages can be
accessed from the same Web server, you are not required to port your
existing ASP pages over to ASP.NET-compatible pages. [...]
https://msdn.microsoft.com/en-us/library/ms973813.aspx

VS2013 Project routing with both WebForms, MVC and Web-api

I use a new VS2013 project created with WebForms, MVC and Web-Api.
When using Aspx pages, they are displayed without .aspx extension.
Yes, I want to use MVC routing sometimes, and also aspx pages without any routing, but I would like to see .aspx extension.
Can I do that ? Thanks.
(In an old WebForms project I manually Added MVC fonctionnalities both webforms and mcv worked fine, so I think it's possible...)

Launch an ASP MVC project from a normal .aspx page

I have an existing ASP.NET web site running on .NET 4.5. I need to integrate an ASP MVC 4 project (which is its own fully-functional web application) into it so that when the user navigates to a certain page, the ASP MVC application is launched within the page - almost as if it were in an iframe.
In the main solution I can set both as startup projects, but this is obviously not what I am looking for. Can someone point me in the direction of how to do this? I have never used WCF before, but is this something that it could be used for? Thanks for anything!
You can create a hybrid webforms - MVC application.
To do this you need to:
copy the MVC configuration from the web.config of a new MVC project to your WebForms application web.config
create the standard MVC 4 folders (at least Views, Controllers)
reference the required assemblies
copy the web.config inside Views from the MVC project to the WebForms project Views folder
change the routing configuration to ignore routes including .aspx/.ascx, so that they are handled by web forms, and not MVC (do this also for .ashx, .asmx, or whatever other web forms based artifacts)
This way you have a single ASP.NET application which supports MVC and WebForms, and use the same authentication, session, and so on.
Then you can make this kind of integrations:
- make pages that are fully MVC or fully webforms. If you're using master pages, you need to create a master page for web forms, and a layout for MVC (this can be very hard or quite easy, depending on its content and design)
- make a webforms page and integrate the MVC pages using AJAX and MVC partial views
Aprt frommy comments, this blog entry will help you a lot: Integrating ASP.NET MVC 3 into existing upgraded ASP.NET 4 Web Forms applications
By the way, this is not theoretical... I have a web application with lots of pages, areas, and views, which uses this technique, and it works flawlessly. I had to redo the design of the master page (layout and CSS) so that both kind of pages look alike. I was lucky enough to have a menu rendered in a webforms placeholder using a SQL XML query and an XSLT, so re-using it in the MVC layout was absolutely easy. You can do something similar to this in your master page and MVC layout (I mean rendering the HTML manually, and using it in both pages, so that it's done only once)
You can take some time to get it to work, but it's worth the effort.

How do I register a web service in a classic asp site

I am working with a classic asp website.
I have created a few ASP.Net pages (ASPX) that we jumped to from an asp page.
The ASP.net pages are using web services to collect and save data. When testing the pages locally I set the references to the web services in my test website (ASP.net).
My question is how to I register the web services in the classic asp website?
Is there anything I need to be aware of that may happen to the classic asp website if it is opened in studio 10 and has references added to it?
this is a live site so having it go down is not an option.
Thanks

Resources