Visualforce vs. ASP.NET

What is VisualForce?

Think of Visualforce (VF) as a HTML page, plus a set of additional tags for accessing objects. Typically VF is used when you want to customize the default page layout which has been generated for you by, override standard buttons, define custom tabs – and add menus items (or actions or mobile cards ) in the SF1 mobile app.

Another use of VF page is when you want to embed a component like a report or chart inside UI. You can also embed an external application like (MS Great Plains), within Salesforce UI. For this, you will create in Salesforce something called a “Canvas” app which calls your external app – and embed it in a VF page. This page can then be inserted anywhere in your UI.

In yet another use of VF – say you want to embed Salesforce UI as an iFrame in your MS GP. You will create a VF page which accesses objects and embed this VF page in your MS GP application.

Visualforce & ASP.NET

A Visualforce page essentially consists of HTML tags, CSS, JavaScript – plus additional tags for accessing data or components (e.g. charts, external apps). These additional tags can call an Apex class which are called controllers.

Just like ASP.NET – in VF there is separation of markup from code and form posts can invoke code methods.

ASP.NET on the other hand is a broader concept. In 2015, the new ASP.NET 5 refers to four different things – ASP.NET Web Forms, ASP.NET MVC, ASP.NET Web Pages and ASP.NET Single Page apps.

VF traverses both the worlds of ASP.NET Web Forms & ASP.NET MVC. You will find VisualForce very similar in its ease of use – & ability to have view states – to ASP.NET Webforms. However clean separation of concerns (SoC) through controllers, and easier integration with client side tools (e.g. embedding components) make VF similar to ASP.NET MVC.

Unlike ASP.NET, Visualforce pages are not themselves programmable objects – there is no DOM object tree; however VF pages can be associated with multiple controllers (Apex classes).

There is no drag and drop UI for Visualforce, but many AppExchange ISVs have created tools like SKUID – which make VF creation very easy. You can do a lot using little or no code in VF including complete customization of UI and cross platform UI (e.g. for mobile and tablets).