An Introduction to the MForm Web Controls | CodeGuru

An Introduction to the MForm Web Controls

The source code The project described in this article is hosted on mform.codeplex.com. You will find the most recent version (the project is recently updated) here.  Introduction   It is most likely that you have seen probably the best beer in the World commercial. Less chances are that you have heard of the MForm webcontrols. And […]

Written By
CodeGuru Staff
CodeGuru Staff
Aug 3, 2009
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

The source code

The project described in this article is hosted on mform.codeplex.com.

You will find the most recent version (the project is recently updated) here


Introduction  

It is most likely that you have seen
probably the best beer in the World
commercial. Less chances are that you have heard of the
MForm webcontrols
. And if you are like me a web developer struggling with
writing web forms that collect and process loads of data, you surely might find
the described controls interesting.


Project background 

The MForm webcontrols project has been started in the IT departament of Bank Millennium,
Poland, a place where I work. It has been recently published under the Microsoft
public license.

If you have ever applied for a loan or a mortgage, you already know that banks want to know as much as possible about their clients to minimize the risk of giving too much money to a person that cannot afford returning it in the
future. All of this data is filled in by bank consultants into bank’s intranet application
during a meeting with the client.

The duty of a bank IT developer is then to:

  • define the data contract (a data structure and data restrictions) for the information
    that the business department wants to collect; 
  • create a web form (or several web forms) that collects the data according to the
    data contract;
  • validate the fields in the web form against data restrictions;
  • combine the data from the fields into the data structure;

Finally the data is sent somewhere else, where it is used to make a decision about
the client.

What struck me, was that all of these tasks looked like they could be made at least
partially automatically. The forms could be generated directly from the data contract
(in our case the data contract was defined using XML schema), the validations (at
least those basic ones as checking field requirement, its maximal length, matching
a pattern or maximal value) could be also taken from the data contract, finally
the data combining (creating an output XML instead of a collection of fields) could
be done automatically.

Still, the solution had to be extensible enough to:

  • allow modifying the created forms visually after the generation;
  • allow adding custom business validations that would work the same way data validations
    work; 
  • make the process of creating the forms as easy as possible, so that even an unexperienced
    developer could prepare at least a web form sketch;
  • be efficient and use Ajax to eliminate unnecessary PostBacks;
  • use generic ASP.NET controls and solutions wherever possible;
CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.