ASP.NET
  Home arrow ASP.NET arrow Page 3 - 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 
Moblin 
JMSL Numerical Library 
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 Your Mailbox List


    (Page 3 of 5 )

    To see the mailbox list, we use three pages: Main.aspx, LeftTree.aspx, and MailDesktop.aspx, respectively, which concretely contain the following functions:

    • Display the mailboxes in tree-like form;
    • Display the mailboxes in table-like form;
    • Provide the hyperlink to rename a mailbox;
    • Provide the hyperlink to check the e-mails in a mailbox;
    • Provide the hyperlink to create a new mailbox; and
    • Delete a mailbox.

    As the main page of the whole online e-mail system, the Main.aspx page is composed of two HTML frame elements (i.e. <frame>) named Left (used for loading the LeftTree.aspx page) and Desktop (used for loading the  MailDesktop.aspx page) respectively. The following gives you the crucial HTML code related to this:

     

    <frameset id="Frame" cols="180,*" rows="*" border="0" framespacing="0">

      <frame name="Left" src="LeftTree.aspx" scrolling="no" frameborder="0" noresize="true">

      <frame name="Desktop" src="MailDesktop.aspx" scrolling="auto" frameborder="0">

    </frameset>

     

    And Figure 6 illustrates the run-time snapshot of the main.aspx page (called by the index.aspx page) in Microsoft IE:

    Figure 6-the run-time snapshot of the main page of the online e-mail system

    The LeftTree.aspx page is responsible for showing the mailboxes in a TreeView control corresponding to the left part in Figure 6. When initialized, the Page_Load function invokes a helper function named InitOperationTree to bind the data to the OperationView control (i.e. the TreeView control in Figure 6):

     

    protected void Page_Load(object sender, EventArgs e) {

      if(!Page.IsPostBack)

      { ///initialize the operation tree

        InitOperationTree();

      }

    }

    private void InitOperationTree()

    { ///obtain data

      IFolder folder = new Folder();

      SqlDataReader dr = folder.GetFolders();

      ///fine the mail folder node

      TreeNode mailFolderNode = OperationView.FindNode("-1/0");

      if(mailFolderNode == null) { return; }

      ///add the mail folder

      while(dr.Read())

      { ///create the node

        TreeNode node = new TreeNode();

        node.NavigateUrl = "~/ViewMail.aspx?FolderID=" + dr["FolderID"].ToString();

        node.Target = "Desktop";

        node.Text = dr["Name"].ToString();

        node.Value = dr["FolderID"].ToString();

        mailFolderNode.ChildNodes.Add(node);

      }

      dr.Close();

    }

     

    In the helper function InitOperationTree above, we first call the GetFolders method of the Folder class to obtain the required dataset, then find the mail folder node, and finally add the folder information from the dataset onto the TreeView control through a typical while loop. Note that when we create the tree node, we set up the hyperlink to the related folder in the ViewMail.aspx page.

    With regard to viewing the mail list, this is accomplished through the MailDesktop.aspx page (which corresponds to the right part of Figure 6) whose design-time snapshot in shown in Figure 7 below.

    Figure 7-the design-time snapshot of page MailDesktop.aspx

    This page is rather simple, with merely a GridView (named FolderView, used to display the mailboxes) and a Button (named NewFolderBtn, used to add new mailbox hyperlink) on it. When the MailDesktop.aspx page initializes, we bind data to the FolderView control (i.e. show the information in the specified mailbox). Since this code is quite similar to that of the LeftTree.aspx page, we omit it. When you click on the NewFolderBtn button, you will be directed to another page, namely NewFolder.aspx, to create the required mailbox hyperlink.

     

    Response.Redirect("~/NewFolder.aspx");

     

    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

    - 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
    - Developing a Dice Game Using ASP.NET Futures...
    - Completing an ASP.NET AJAX Server-Centric Ba...
    - Information Management for an ASP.NET AJAX S...
    - Comment and Order Management for an ASP.NET ...





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