What is the best way to upgrade my Classic ASP WebApp? Advice and Opinions Needed - asp-classic

I am currently maintaining an in-house business tool for our company's timesheets and project information. I need some general advice regarding web languages and best practices.
Details:
Runs on Windows Small Business Server 2008
Combination of Classic ASP, JavaScript, CSS and Javascript
Access database backend
Large system, containing around 135 pages, of 2.3 MB total
Objectives:
Extend functionality in small ways
Possibly move to different languages to ease maintenance (AJAX?)
Separate code from HTML structure (currently VERY messy)
1) Given that I don't have a lot of time to entirely rewrite the system, is it sensible to keep going with ASP and JavaScript?
2) I've had a look at some AJAX and it seems like it would be an easy leap to include it in the page, is this an avenue worth pursuing?
3) Is it worth investigating an MVC framework? If so, does this need to be done formally with some kind of library, or are there best practices I can follow to implement MVC functionality using ASP?
4) How difficult might it be to upgrade to a 'real' DBMS such as MySQL and port the database? Is it worth doing? (Feel free to smack-talk Access)
Sorry for the length, I'm just a little lost in the giant multitude of Web standards, languages and practices.

1) For the javascript part take a look at Jquery. Normally this cuts down old javascript code to 1/10 of size and a better separation of ASP/HTML Code and JS Code. Ajax comes for free and it has a really good plugin ecosystem.
3) From my experience porting such a big system is not a good idea.
ASP Classic runs smoothly under IIS 7.5 ans IIS Express so you can take the good parts like Url Rewrite and other IIS plugins. If you need more power in your ASP classic pages simply combine them with ASP.NET pages. It is no problem to run them side by side, I usually use ASP.NET generic handler (.ashx) if I need the power of the .NET Framework to complete tasks like dynamically generated Zip files for example.
4) Upgrade to Sql Server Express.
Microsoft SQL Server Migration Assistant (SSMA) will help you to convert the Access DB to SQL Server. I've done this before with a 1 GB (no binary data) 200+ tables database and migrated the old ASP system in a week to SQL Server.
With Jquery, IIS 7.5 or IIS Express, .Net Framework 4.0 and Sql Server 2008 Express you can "pimp" your system in much less time than porting it completely.

Seriously, if the thing works and performs for you as is, then I'd "extend the functionality in small ways" and possibly add in some Ajax, if you think it would offer enough value given you limited time.
I'd certainly not consider porting a 135 page application just for the sake of porting it.
Access has its issues, but if you're not running in to them, I wouldn't take the time now to convert it.

Related

Best practise to migrate Web Forms to ASP.NET Core MVC

I am trying to migrate a project from classic ASP.Net Web Forms to ASP.NET MVC.
While I have read through http://www.codeproject.com/Articles/38778/ASP-NET-WebForms-and-ASP-NET-MVC-in-Harmony. I have a basic idea on how the code structure, libraries and routing should be done.
For your information, the scope of my existing project is around 400 pages and 300 tables.
On top of my head I have two approaches:
Start from stretch, rewriting the whole system - Obviously this would require intensive work and take a long time. Any change made on existing system would need a duplicate change made to the new system.
Migrate the page one each - I still have a rebuild the entire core library (for accessing db), and get the page migrated one by one. For this I would assume to have two core libraries (new and old) running simultaneously with different pages connect to one of those.
Would anyone have similar experience and advise a proper way to start?
For this complete revamp I may also target at the latest technology - .NET Core and MVC6, by taking these would I have extra advantage, or some blockages I would have to take care of?
Any suggestion and opinions are appreciated. Cheers.
Microsoft is a bit hush hush on the subject but the WebForms engine is probably never going to make its way to ASP.NET Core. One might think that MS is waiting to see if the community is calling for a port, but I think they're trying to kill it discretely (not like Silverlight).
Why? Because it proved to be a bad good idea on the long run, easy to use at first, but extremely complex to master (because of viewstate and page lifecycle), with a tendency to allow average developers to build very tedious application (in french we say steam factories). Also it was very poorly adapted to modern web development (Ajax, unit testing, IoC). They tried to fix it with a couple of tweaks, but the overall architecture is just not adapted to this kind of things. MVC is a treat in comparison!
To answer your question, it's not really possible to migrate WebForms to MVC, because those are quite different architectures, and of course the architecture is what an application sits on top on, so if you change it, you might as well rewrite it from scratch.
What can help you a lot is if your app is divided in tiers (business, data access, UI). If it's not the case, you could start by doing this, properly separating the UI project from the rest. Then you would just have to rewrite the ASP.NET project and not the rest.
There are some useful resources I'd like to share with the StackOverflow community just in case you are having troubles to decide what to do:
modernization of your existing Web Forms app
migration to MVC or Core
or whether to start a new project on Web Forms, MVC and Core.
Here you go:
https://www.telerik.com/blogs/review-of-telerik-toolsets-for-aspnet-web-forms-core
Modernizing ASP.NET Web Forms Applications by Tomáš Herceg (Microsoft MVP ) - https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-1
Migrating Old ASP.NET Applications to .NET Core by Edi Wang (Microsoft MVP) - https://edi.wang/post/2018/10/31/migrating-old-aspnet-applications-to-net-core
Choose between ASP.NET and ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
Migrate from ASP.NET to ASP.NET Core (Microsoft docs) - https://learn.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1
i have come across below links
https://www.youtube.com/watch?v=CZuqMrWSano
https://www.dotvvm.com/blog/59/Modernizing-ASP-NET-Web-Forms-applications-with-DotVVM
DotVVM package helps us to migrate ASP.Net Web Forms migration to ASP.NET Core without re-writting completely.
i have not tried any production application. still have tried some sample pages. you can try this out.
I can agree that for many cases a re-write of an ASP.NET application where WebForms is used widely may do not provide any business value.
Therefore we decided to use our experience with ASP NET WebForms to develop a highly compatible port of WebForms for ASP NET Core / .NET 6.0.
We use the solution in our own ASP NET WebForms-based products and projects as well as a licensable component library.
So the Forms can still be used and you can focus on the .NET CORE/6 migration.

Web Matrix: should I use it if I am already well versed in VS?

I have been reading a bit about Web Matrix, I like the simpleness of it. But should I even bother if I am already using VS2010 pro? I was thinking maybe for small clients that want a simple site with a blog it may make things quicker? Is it worth looking more into?
And if I do make a simple site with wordpress with web matrix, I should still be able to host it on an apache server, even though web matrix is a microsoft product?
thanks!
The question could use some tweaking. You're asking which IDE to use, but you you really mean simple - (Web Pages and or Packages like WordPress) vs complex - traditional ASP.Net (Web Forms and or MVC).
That said, Microsoft is acknowledging the various minimalist movements going on in their community. People are rejecting the idea that the complexity of the ASP.Net, WCF, IoC, DDD is necessary in every project.
Out of this movement you see projects like OpenRasta and OWIN are pushing for simpler servers and services. While projects like Nancy look to simplify the application stack. And dapper and massive both are attempts to simplify data access.
Microsoft's answers to this are asp.net web pages, supporting php, and things like WCF Web API.
For your own direction, you need to decide if the benefit of having a simpler option is worth the effort of learning multiple frameworks (say web pages for simple and mvc for complex), or if you want to only know one framework and pay a productivity penalty when putting the proverbial square peg in a round hole.
WebMatrix is about the programming framework rather than the IDE. You can use VS to create WebMatrix sites, which has several benefits over the WebMatrix IDE including Intellisense. In fact if you open a site in the WebMatrix IDE and have VS installed you will get an "Open in Visual Studio" icon on the toolbar.
I would definitely recommend using WebMatrix for smaller sites.

Migration of asp to asp.net(c#.net)

I've a website developed in classic asp.
Now I want to convert it to asp.net(2.0 or above).
How can I do it without coding from scratch?
Can you suggest a free or cheap tool to do the work?
In my experience when you switch platforms like this you are basically doing a full rewrite. Any conversion tools that you find will end up producing code that 1) probably doesn't fully work, and 2) is messy code in the destination language that will be hard to maintain.
Then of course there is the bigger problem: you most likely want an entirely different architecture in ASP.NET versus what you had in ASP. Better to revisit the requirements of the application, think about the architecture and design, and reimplement. Use the source code as a guide for how certain pieces work, but don't do a pure conversion.
I don't think there is any good news here. Automatically translating ASP code to ASP.NET will require a lot of busywork. Perhaps you can farm out to an offshore developer who can do this gruntwork for you?
Rename all the pages to .aspx (or of cource configure iis to use .net to process .asp pages). Classic asp runs fine in .net. Now start one page at a time and change only the stuff that actually benifits from being asp.net. Just an option. I'm just saying.
Using asp to asp.net migration assistant we can do it. I could convert my asp project to asp.net 1.x using asp to asp.net migration assistant.
But there were a few run time errors as well as DB connecting problems after the conversion.........
System Requirements
Supported Operating System
Windows 2000, Windows 98, Windows ME, Windows NT, Windows XP
Microsoft .NET Framework Version 1.1 Redistributable Package
as per http://www.microsoft.com/en-us/download/details.aspx?id=18312

Why migrate from IIS6 to IIS7?

I have a number of web apps running on several IIS6/Server 2003 boxes. They run well and are happy. They are all asp.net web apps and use .NET 3.5.
What, if any, would be valid reasons for contemplating moving the web apps to IIS7/Server 2008?
IIS7 is rewritten from the ground up with a concept of being "pluggable". IIS7 is more extensible than it ever has been before. The entire request pipeline has be reworked to allow you to more easily work with requests, as well.
From a performance aspect, these changes are immediately recognizable. You can run sites developed for IIS6 in a "Classic" application pool that will preserve compatibility, but provide a noticeable performance boost. In the non-scientific evaluation that we have done so far, our legacy application has seen about a 20% reduction of load times on our IIS7 test machine.
Of course, the reason we have to run in "classic" mode is an interesting side note. Inside the global.asax, there is some pre-fetching on application start which touches the HttpContext. Specifically, there is pre-caching done, which IIS7 does not allow. So, before we can switch from "classic" mode, there are some changes that we will have to make.
Eventually, Microsoft will discontinue Server 2003 support. Admittedly, that won't be for several years, so it doesn't impact you today.
Improved support for ASP.NET MVC. This is probably the big one for most of us. You can get ASP.NET MVC working on IIS6, but there are some hoops to jump through.
I'd give you more, but I myself am not yet on Server 2008 yet, and have nothing else to give. Presumably Vista (which I do use, both at work and at home) has the "same" IIS7 as 2008 does -- the UIs certainly look very similar -- but I wouldn't consider my experience there to be useful to your question.
Ability to write pipeline components in managed langauges. Previously, if you wanted to write an ISAPI filter to handle a certain type of web request, you'd have to write it in C++. Now, you can use good ol' .NET code. This allows more customization with the ability to write reusable pipeline components for handling various types of request. For example, all .js file request are routed to a ScriptCompressor pipeline component which zips and returns them with lots of cacheability set up.
The improved support for MVC is linked to this as you can set II7 to route requests without extensions to .NET so you can have urls which are "cleaner" such as http://www.yourwebsite.com/customer/1 without having any extension visible which reveals what type of server technology you're using and is very untrendy these days.

What is ASP.NET?

I've been strictly in a C++ environment for years (and specialized statistical languages). Visual Studio until 2001, and Borland since. Mostly specialized desktop applications for clients.
I'm not remaining willfully ignorant of it, but over the years when I've dipped into other things, I've spent my time playing around with JavaScript, PHP, and a lot of Python.
Is "ASP.NET" the language? Is C# the language and "ASP.NET" the framework? What's a good answer to "What is ASP.NET"? Is there a correspondence between ASP.NET and anything I'd be familiar with in C++?
I know I can google the same title, but I'd rather see answers from this crowd. (Besides, in the future, I think that Google should point here for questions like that.)
I was going to write a lengthy answer but I felt that Wikipedia had it covered:
ASP.NET is a web application framework
developed and marketed by Microsoft,
that programmers can use to build
dynamic web sites, web applications
and web services. It was first
released in January 2002 with version
1.0 of the .NET Framework, and is the successor to Microsoft's Active Server
Pages (ASP) technology. ASP.NET is
built on the Common Language Runtime
(CLR), allowing programmers to write
ASP.NET code using any supported .NET
language.
So ASP.NET is Microsoft's web development framework and the latest version is 4.0.
How do I get started? Check out the following resources:
Learn ASP.NET
ASP.NET Documentation
ASP.NET Developer Center
ASP.NET is the framework, just like .NET
The code itself, will be a mix of HTML, JavaScript(for Client-Side) and any .NET compatible language. So C#, VB.NET, C++.NET, heck...even IronPython
ASP.NET is a web application framework
developed and marketed by Microsoft,
that programmers can use to build
dynamic web sites, web applications
and web services. It was first
released in January 2002 with version
1.0 of the .NET Framework, and is the successor to Microsoft's Active Server
Pages (ASP) technology. ASP.NET is
built on the Common Language Runtime
(CLR), allowing programmers to write
ASP.NET code using any supported .NET
language.
ASP.NET (Wikipedia)
That's on the second result searching on Google so I'm guessing (half-expecting) that you don't understand what that means either.
Webpage development started with simple static HTML pages. That meant the client asked for a page by means of an URL and the server sent the page back to him/her exactly as it has been designed. Sometime after that several technologies emerged in order to provide a more "dynamic" or personalized experience.
Several "server side languages" were developed (PHP, Perl, ASP...) which allowed the server to process the Web page before sending it back to the client. This way when a client requested a webpage the server could interpret the request, process it (for example connecting to a database and fetching some results) and send it back modifying the contents and making them "dynamic". The fact that the process took place on the server stands for the name of "server side".
So the original ASP (predecessor of the ASP.NET) was a server side language that was focused on serving web pages. In such way it supported several shortcuts such as the possibility to intercalate HTML and ASP source into the file which was on that time much popular due to PHP implementation. It was also (as most of these languages) a dynamic language and it was interpreted.
ASP.NET is an evolution of that original ASP with some improvements. First it does truly (try to) separate the presentation (HTML) from the code (.cs) which may be implemented by using Visual Basic or C# syntax. It also incorporate some sort of compilation to the final ASP pages, encapsulating them into assemblies and thus improving performance. Finally it has access to the full .NET framework which supports a wide number of helper classes.
So, summing up, it is a programming language located on the server and designed to make webpages.
ASP.NET is a framework, it delivers:
A class hierachy you hook into, that allows both usage of supplied components, as well as development of your own.
Integration with and easy access to the underlying webserver.
An event model, which is probably the "best" thing about it.
A general abstraction from the underlying medium of HTML and HTTP.
Not sure if ASP.NET compares to any C++ frameworks you may be familiar with. Web frameworks usually tend to be unique due to the statelessness of HTTP and the relatively low-tech technologies involved (HTML, scripting, etc).
Let's say it's a technique from MS to build web applications. ASP stands for Active Server Pages, .NET is the framework behind it.
C# and VB.NET are the languages which can be used, but I guess other .NET languages also can be used.
Take a look at MS' info for those who don't know or understand the platform.
http://www.asp.net/get-started

Resources