DotVVM page inside ASP.NET webForms Site.master - webforms

I have an existing ASP.NET webForms web site project. I would like to use dotvvm in one page of the website. I have successfully created and placed a sample content page .dothtml inside dotvvm master page .dotmaster but is there any way I can place it inside my website Site.master?
I have tried to use the Site.master as master page like that:
#masterPage Site.master
but it gives me an error message because Site.master doesn't have #viewModel line at top of it.
I am working with visual studio 2015 community version with 4.5.2 .NET framework

Unfortunately, DotVVM doesn't have this level of integration yet.
If you want to combine ASP.NET Web Forms and DotVVM pages in one application, you need to create a DotVVM master page which uses the same layout and CSS.

Related

Which Visual studio template to use for web-app. (Standard / MVC)

Having to select a template when creating a new project in Visual studio, which of the 2 should pick?("asp.net core web app" ...or... "asp.net core web app (model-view-controller)")
In order to try and discover the answer for myself, I'd have to create 2 different projects and compare the features and capabilities. If I knew what to look for, it might been easier.
if the on template is MVC, then what is the non-MVC actually then?
If I go for the one project, would I be able to convert to the other later then? (and vise versa)
The simplest explaination is: In asp.net core you work with web pages where each of the webpages (Razor pages) has a code behind file. In asp.net core web app (Model View Controller) your code behind is kind of centralised, in a controller file, and this code redirects to different view files. There is more to this than that. Furter explaination can be found on from page 12 of in this document: https://dotnet.microsoft.com/en-us/download/e-book/porting-aspnet-apps/pdf

Creating Orchard Module with aspx View Engine

i have an existing MVC3 Application.
This application uses the Razor view engine AND the aspx Viewengine (for rendering telerik reports).
I want to integrate this MVC Application to Orchard (never used Orchard before).
My question is:
is this possible?
can orchard render views with a aspx viewengine?
thanks for your answers!
Orchard can render aspx, yes, but to make this application work inside of Orchard you'll have to transform it into an Orchard module. if those aspx reports are not MVC but use Webforms postbacks you probably won't be able to use them unless you isolate them into a separate application.
The question to ask would be why do you want to integrate this MVC app to Orchard?

VS2010 MVC3 - Spark not showing in View Engine dropdown

I am in the process of converting a good sized asp.net 4 site to MVC3 and I am having trouble with the helper functions in razor partial views. So I wanted to try Spark but after using NuGet to install Spark in my project I don't see how to create a Spark view.
I am assuming that Razor and Spark will co-exist in the same project? If that is not true, then that is probably my problem.
When I treid to create a new view I expected to see Spark in the View Engine drop down on the Add View dialog. Only razor and aspx show up.
I have restarted vs2010 several times now and I shouldn't need to reboot.
Any suggestions?
Take a look at the following blog post.

Asp.net MVC Site.master and Razor Switch

I recently converted a project to visual studio 2010 then to mvc 3 and now converting views to razor views.
It's all working fine but I notice i cannot get rid of the site.master and replace it with _layout....
Every time, i start the website the default page is always rendered by site.master even tho I see it calling a controller that uses a view that uses the _layout.cshtml
I am wondering if there is at any point anywhere in the file that says the default MasterPage is the site.master ?
Make sure your _ViewStart.cshtml is pointing to the right masterpage.
#{
Layout = "~/Views/Shared/_Layout.cshtml"
}
Beyond that, if site.master is not found in ANY of your code (solution wide search). Try restarting your application.

Why does the default ASP.NET MVC 3 project not use controllers?

Upon creating a new ASP.NET MVC 3 Razor site, there are 9 Account\*.cshtml files which seem to be views with the controller logic inserted at the top of the view in an anonymous code block. There is no account controller class.
Why is this? As I understood, the benefit of MVC was the separation of concerns of code & presentation. Does this imply that I should remove all of the existing files & re-implement the Authentication & Authorisation layers?
It seems odd that MS would ship the 'worst possible example' with their flagship web framework.
Thanks,
Jarrod
Edit: I was using the wrong entry point within visual studio to create the application (see my comment below). Thanks!
Hmm, something is not quite right on your end.
I just created a new ASP.NET MVC3 Web Application.
I do have a 'Controllers' folder with a proper AccountController as part of the project.
Are you using Visual Studio?
This is incorrect. Here's the default folder structure in the MVC3 Razor starter app:
As you can see, there are two controllers in the ~/Controllers folder.
Just to be clear, I started a new VS2010 instance, created a new MVC3 project, selected "Internet Application" and Razor as the view engine.

Resources