Click here to Skip to main content
13,053,531 members (56,339 online)
Click here to Skip to main content
Articles » Web Development » ASP.NET » Howto » Downloads

Stats

199.4K views
20K downloads
60 bookmarked
Posted 9 Apr 2010

Mobile Application Development in ASP.NET

, 9 Apr 2010
ASP.NET provide features to develop appllication for mobile devices. System.Web.Mobile namespace is devoted specifically to mobile Web development.
LRC_Src
App_Code
StyleSheet
MobileWebFromTemplate
Web Application
MobileWebForm.zip
MobileWebUserControl.zip
Web Site
MobileWebForm.zip
MobileWebUserControl.zip
Mobile Emulator
MME30.exe
using System;
using System.Web.Mobile;
using System.Web.UI.MobileControls;
using System.Text;
using Microsoft.VisualBasic;

namespace STL.Web.Mobile.UI
{
    public partial class Loan_RepaymentCalculator : System.Web.UI.MobileControls.MobilePage
    {
        #region Event

        protected void Page_Load(object sender, EventArgs e)
        {
            Initialize();
        }

        protected void cmdRepayment_Click(object sender, EventArgs e)
        {
            if (!Page.IsValid) return;
            try
            {
                Double dblPrincipal = double.Parse(this.PrincipalAmount.Text);
                Double dblApr = double.Parse(this.Rate.Text);
                Double dblMonthlyInterest = (Double)(dblApr / (12 * 100));
                Int64 intTermInMonths = Int64.Parse(this.Term.Text) * 12;
                Double dblMonthlyPayment;

                dblMonthlyPayment = Microsoft.VisualBasic.Financial.Pmt(dblMonthlyInterest, intTermInMonths, -dblPrincipal, 0, Microsoft.VisualBasic.DueDate.BegOfPeriod);

                this.ActiveForm = this.frmResult;

                StringBuilder sbDetailsSpec = new StringBuilder("");
                sbDetailsSpec.Append(String.Format("{0} @ {1}% for {2} years <br /> Payment: ", dblPrincipal.ToString("C0"), dblApr.ToString(), this.Term.Text));
                sbDetailsSpec.Append("<b>" + dblMonthlyPayment.ToString("C") + "</b>");
                this.tvLoanDetails.Text = sbDetailsSpec.ToString();
            }
            catch
            {
                this.ActiveForm = frmError;
            }
        }

        protected void cmdBack_Click(object sender, EventArgs e)
        {
            this.ActiveForm = this.frmInput;
        }

        #endregion Event

        #region Method

        private void Initialize()
        {
            this.frmInput.Title = UIConstant.TITLE_BAR;
            this.frmResult.Title = UIConstant.TITLE_BAR;
            this.frmError.Title = UIConstant.TITLE_BAR;

            this.lblHeading.Text = UIConstant.PAGE_TITLE;
            this.lblHeadingResult.Text = UIConstant.PAGE_TITLE;
            this.lblHeadingError.Text = UIConstant.PAGE_TITLE;
        }

        #endregion Method
    }
}

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)

Share

About the Author

Abdul Quader Mamun
Team Leader
Bangladesh Bangladesh
No Biography provided

You may also be interested in...

Pro
Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 9 Apr 2010
Article Copyright 2010 by Abdul Quader Mamun
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid