How to use existing Masterpage.Master in asp.net web project to another MVC4 _layout.cshtml project? - asp.net-mvc-4

Please help me out that I have an existing project with Masterpage.master file and I want to use that design to new MVC4 project. so how can we incorporate this functionality. Please help.

Related

could not run the ASP.NET Core MVC application

when i run the ASP.NET Core MVC application from Visual studio 2022, it getting conflicts with source and module file(please refer the attached image.)
We are migrating MVC5 project to ASP.NET Core MVC and i dont know these initial configuration settings
Pls assist me on this
Thanks
I need to run the application in the browser.
Please delete the bin folder and rebuild your project.

asp.net core 3.1 accountcontroller missing when creating new project

when I create a new project asp.net core 3.1 with Visual Studio with Individual User Accounts selected.
I can't find the Account Controller folder. There is an Areas folder but almost empty
Identity is working but where are the codes?
You are looking for scaffold identity
To add Identity scaffolding to a project, read:
https://learn.microsoft.com/en-us/aspnet/core/security/authentication/scaffold-identity?view=aspnetcore-3.1&tabs=netcore-cli#scaffold-identity-into-an-empty-project
However for .Net 3.1, you’ll need to add these via NuGet and select the 3.x.x versions, else dotnet will try to install the latest .Net 6 which is incompatible with .Net3.1…
Also, having done all that, you get the Area/Identity/Pages/Account folder with more .cshtml files. But still don't see the AccountController in the Controllers folder.
It turns out the code for each operation is in the .cs files for each of the views in the Account folder, per Razor page paradigm.

How to create whole solution from published files of an asp.net core 3.1 project?

I lost one week of development because of not committing my code. I work on a personal project and I lost my code I only have the published version of my asp.net core 3.1 project. and my code is not obfuscated.
I use DotPeek to open my main dll and I get controllers but there are no views in there ? I wonder to know, is there any way for me to create a solution like I had without creating views by my hand?
Is it possible to completely regenerate Visual Studio solution folder for this project from Published files?

How to create .razor files

I've created a Blazor project using .net core 3.0 preview5 and VS2019 Enterprise. I want to create .razor files, but all of my options have .cshtml extensions.
When I'm creating my project, I'm using asp.net core 3.0 and Blazor server hosted options
In VS 2019 16.3.0, adding "Razor Component" is what worked for me.
What works is:
Add, Add Class
and then change .cs to .razor before clicking [Add]
And immediately delete all the C# stuff of course.
Or you can copy/paste/rename any existing blazor component, like index.razor.
Make sure you've got the blazor extension installed.
This should then allow you to click on the Pages Directory and at the top there's an Add Razor Page option.
But I've got to admit, I tend to find it quicker to just select an existing page in the solution explorer and Ctrl-C Ctrl-V and rename it!
Note: At time of writing this is using the preview branch of Visual Studio 2019 and frameworks.
Right click on Pages-> Add->New Item...-> Razor Component

How to create custom control in mvc 4 razor view which is pluggable to another mvc 4 razor view projects

I want to create a custom control in mvc4 razor view engine which is to be created as a dll
and that dll will be pluggable to another mvc 4 razor projects.
Thanks in advance.
There's a post here on using the Razor File Generator, which addresses the same issue as you have http://blogs.msdn.com/b/davidebb/archive/2010/10/27/turn-your-razor-helpers-into-reusable-libraries.aspx
The project is in codeplex, so you can get the Source Code and the Documentation any any other information from here.