简体   繁体   中英

Converting HTML (or Classic ASP) to ASP.NET

I was wondering if there is a way to convert and HTML template to ASP.NET? I am trying to convert a website template that was written in HTML that contains Javascript and CSS files to ASP.NET so I can connect to a SQL Server database.

I have limited coding experience with ASP.NET so any help is appreciated!

I also have access to an ASP template but it is not ASP.net unfortunately.

I'm afraid to say you are going to have to get familiar with .NET for this however I like many others had to do this back in the day... although now you have many other factors like are you going to migrate to a Webforms based ASP.NET application or an ASP.NET MVC application.

You can just put your HTML content into an .aspx page however you are going to have to learn the fundamentals of .NET and perhaps things like ADO.NET, LINQ to SQL, nHibernate to get connected to a database.

This may help, but it is rather old: http://www.asp.net/web-forms/videos/migrating/migrating-from-classic-asp-to-aspnet

Microsoft do have a lot of information to help you make this transition... http://www.asp.net/get-started

Not the best answer I realise but you will have to take on a bit of a learning curve, and who knows, you may end up loving .NET, C#, VB, etc, etc... Trust me, it won't be that hard!

There's no easy way to do what you're asking. You can save it as a .aspx page instead of .html, but you can't magically make it connect to the database without coding adjustments.

Just create a new aspx page and copy the content to the aspx file. You should not face any issue in keeping original Html tags in aspx page, but if you need to do some sort of logic on cs file then you might want to change the Html tags to asp tags. which, again should be easy.

And to connect it to database, may be you would like to connect it from cs file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM