Click here to Skip to main content
15,881,281 members
Articles / Web Development / IIS

Mobile Application Development in ASP.NET

Rate me:
Please Sign up or sign in to vote.
4.93/5 (40 votes)
9 Apr 2010CPOL11 min read 290.2K   21.2K   62  
ASP.NET provide features to develop appllication for mobile devices. System.Web.Mobile namespace is devoted specifically to mobile Web development.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Loan_RepaymentCalculator.aspx.cs"
    Inherits="STL.Web.Mobile.UI.Loan_RepaymentCalculator" %>

<%@ Register TagPrefix="mobile" Namespace="System.Web.UI.MobileControls" Assembly="System.Web.Mobile" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <mobile:StyleSheet ID="StyleSheet1" Runat="server" ReferencePath="~/StyleSheet/LRC_StyleSheet.ascx">        
    </mobile:StyleSheet>
    <mobile:Form ID="frmInput" Runat="server" StyleReference="StyleForm">
        <mobile:Label ID="lblHeading" Runat="server" EnableViewState="False" StyleReference="StyleHeader"
            Wrapping="Wrap"></mobile:Label>
        <br />
        <mobile:Label ID="lblPrincipal" Runat="server" EnableViewState="False" StyleReference="StyleLabel">1. Amount</mobile:Label>
        <mobile:TextBox ID="PrincipalAmount" Runat="server" Numeric="True" MaxLength="12"
            Size="10" StyleReference="StyleTextBox" Title="Principal Amount">
        </mobile:TextBox>
        <mobile:RequiredFieldValidator ID="rfvPrincipal" Runat="server" ControlToValidate="PrincipalAmount"
            ErrorMessage="Amount Empty!" StyleReference="StyleValidation">
        </mobile:RequiredFieldValidator>
        <mobile:RegularExpressionValidator ID="revPrincipal" Runat="server" ValidationExpression="^([0-9]+)?\.?\d{1,2}"
            ControlToValidate="PrincipalAmount" ErrorMessage="Invalid Amount!" StyleReference="StyleValidation">
        </mobile:RegularExpressionValidator>       
        <mobile:Label ID="lblTerm" Runat="server" EnableViewState="False" StyleReference="StyleLabel">2. Term(Year)</mobile:Label>
        <mobile:TextBox ID="Term" Runat="server" Numeric="True" MaxLength="6" Size="10" StyleReference="StyleTextBox"
            Title="Term">
        </mobile:TextBox>
        <mobile:RequiredFieldValidator ID="rfvTerm" Runat="server" ControlToValidate="Term"
            ErrorMessage="Term Empty!" StyleReference="StyleValidation">
        </mobile:RequiredFieldValidator>
        <mobile:RegularExpressionValidator ID="revTerm" Runat="server" ValidationExpression="^[1-9]([0-9]+)?"
            ControlToValidate="Term" ErrorMessage="Invalid Term!" StyleReference="StyleValidation">
        </mobile:RegularExpressionValidator>
        <mobile:Label ID="lblRate" Runat="server" EnableViewState="False" StyleReference="StyleLabel">3. Rate(%)</mobile:Label>
        <mobile:TextBox ID="Rate" Runat="server" Numeric="True" MaxLength="5" Size="10" StyleReference="StyleTextBox"
            Title="Rate">
        </mobile:TextBox>
        <mobile:RequiredFieldValidator ID="rfvRate" Runat="server" ControlToValidate="Rate"
            ErrorMessage="Rate Empty!" StyleReference="StyleValidation">
        </mobile:RequiredFieldValidator>
        <mobile:RangeValidator ID="rvRate" Type="Double" MinimumValue="0" MaximumValue="100"
            ControlToValidate="Rate" Runat="server" ErrorMessage="Invalid Rate!" StyleReference="StyleValidation">
        </mobile:RangeValidator>
        <mobile:Command ID="cmdRepayment" Runat="server" OnClick="cmdRepayment_Click">Repayment</mobile:Command>
    </mobile:Form>
    <mobile:Form ID="frmResult" Runat="server" StyleReference="StyleForm">
        <mobile:Label ID="lblHeadingResult" Runat="server" EnableViewState="False" StyleReference="StyleHeader"
            Wrapping="Wrap"></mobile:Label>
        <br />
        <br />
        <mobile:TextView ID="tvLoanDetails" Runat="server" EnableViewState="False" StyleReference="StyleLabelResult">
        </mobile:TextView>
        <br />
        <mobile:Command ID="cmdBack" Runat="server" OnClick="cmdBack_Click">Back</mobile:Command>
    </mobile:Form>
    <mobile:Form ID="frmError" Runat="server" StyleReference="StyleForm">
        <mobile:Label ID="lblHeadingError" Runat="server" EnableViewState="False" StyleReference="StyleHeader"
            Wrapping="Wrap"></mobile:Label>
        <br />
        <br />
        <mobile:TextView ID="tvError" Runat="server" EnableViewState="False" StyleReference="StyleError">
            Sorry For Inconvenience!
        </mobile:TextView>        
        <br />
        <mobile:Command ID="cmdHome" Runat="server" OnClick="cmdBack_Click">Home</mobile:Command>        
    </mobile:Form>
</body>
</html>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
Bangladesh Bangladesh
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions