ASP.NET
  Home arrow ASP.NET arrow Page 4 - Designing the Interface and More for an On...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP.NET

Designing the Interface and More for an Online E-Mail System in ASP.NET 2.0
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 5
    2007-06-12

    Table of Contents:
  • Designing the Interface and More for an Online E-Mail System in ASP.NET 2.0
  • Designing the Data Tier
  • Check Your Mailbox List
  • Check the E-mails in Your Mailbox
  • Creating Folders

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Designing the Interface and More for an Online E-Mail System in ASP.NET 2.0 - Check the E-mails in Your Mailbox


    (Page 4 of 5 )

    Now, let's turn our attention to how to view the e-mails in the selected mailbox, which is done on the ViewMail.aspx page (figure 8 shows the design-time interface).

    Figure 8-the design-time snapshot of the ViewMail.aspx page

    Here, we enumerate the functions of the controls on this page as follows:

    • GridView MailView -- to show the e-mails in the selected mailbox;
    • DropDownList FolderList -- to show the mailboxes/folders to which the selected e-mails are moved;
    • Button DeleteBtn -- to delete the mails checked out (i.e. selected);
    • Button MoveBtn - -to move the selected e-mails to the mailbox currently selected in control DropDownList.

    As discussed in the MailDesktop.aspx page, the main task is finished when the page is loaded. When the ViewMail.aspx page is initialized, we need to perform the following functions:

    1. Obtain the value of the nFolderID parameter;

    2. Display the e-mails within the current mailbox or folder in the MailView control, which is accomplished by calling the helper function BindMailData which in turn invokes the GetMailsByFloder method of the Mail class to get the details (such as mail topic, sending time, sender, and so forth) of all the e-mails in the current mailbox/folder using the nFolderID parameter;

    3. Exhibit the information about the mailbox/folder in the FolderList control,  which is done with the helper function BindFolderData.

     

    int nFolderID = -1;

    protected string AliasName = "AliasName";

    protected string Email = "Email";

    protected void Page_Load(object sender,EventArgs e)

    {

      ///get the value of parameter nFolderID

      if(Request.Params["FolderID"] != null)

      {

        if(Int32.TryParse(Request.Params["FolderID"].ToString(),out nFolderID) == false)

        { return;}

      }

      if(!Page.IsPostBack){

        if(nFolderID > -1)

        {

          BindMailData(nFolderID);

          BindFolderData();

        }

      }

      DeleteBtn.Attributes.Add("onclick","return confirm('Are you sure to delete the selected files?');");

    }

    private void BindFolderData()

    { ///get data

      IFolder folder = new Folder();

      SqlDataReader dr = folder.GetFolders();

      ///bind data

      FolderList.DataSource = dr;

      FolderList.DataTextField = "Name";

      FolderList.DataValueField = "FolderID";

      FolderList.DataBind();

      dr.Close();

      MoveBtn.Enabled = FolderList.Items.Count > 0 ? true : false;

    }

    private void BindMailData(int nFolderID)

    { ///get data

      IMail mail = new Mail();

      SqlDataReader dr = mail.GetMailsByFloder(nFolderID);

      ///bind data

      MailView.DataSource = dr;

      MailView.DataBind();

      dr.Close();

      DeleteBtn.Enabled = MailView.Rows.Count > 0 ? true : false;

    }

     

    Indeed, there is nothing more to be interpreted in the above code, so let's continue the long journey.

    More ASP.NET Articles
    More By Xianzhong Zhu


       · HiThis e mail system does not read from my configured pop3 account.It just shows...
       · Hi my friend there,I'm willing to help you out. When I debugged this sample the...
     

    ASP.NET ARTICLES

    - Disadvantages of the ASP.NET MVC Framework
    - Advantages of the ASP.NET MVC Approach
    - ASP.NET Web Forms Weaknesses
    - ASP.NET Web Forms Meets ASP.NET MVC
    - Source Code for Saving and Retrieving Data w...
    - Using GridView to Save and Retrieve Data wit...
    - Handling Dynamic Images in ASP.NET 3.5 AJAX ...
    - Retrieving Data with AJAX and the GridView C...
    - Playing with Images in ASP.NET 3.5 AJAX Appl...
    - Saving and Retrieving Data with AJAX
    - Enhancing PHP Via the ASP.NET AJAX Framework...
    - Enhancing PHP Programming with the ASP.NET A...
    - Classes and ASP.NET AJAX
    - Using ASP.NET AJAX
    - Building a Simple Storefront with LINQ





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
    Stay green...Green IT