ASP.NET
  Home arrow ASP.NET arrow Page 3 - Building an In-Text Advertising System Und...
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  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
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

Building an In-Text Advertising System Under ASP.NET 3.5
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 2
    2009-01-13

    Table of Contents:
  • Building an In-Text Advertising System Under ASP.NET 3.5
  • Requirements
  • The General Situation
  • Database Design
  • Procedures

  • 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


    Building an In-Text Advertising System Under ASP.NET 3.5 - The General Situation


    (Page 3 of 5 )

    To gain the aim of embedding an in-text ad inside a special web page, you just need to insert the following code at the far bottom of the page:

    <script type ="text/javascript" >var username='222'; </script>

    <script type="text/javascript" src="js/getad.js"></script>

    Here, the variable "username" is the unique identifier used by the website owner to make ad-related statistics.

    Then why select to put the above code at the far bottom of the page? This mainly prevents the possibility of the ad code deferring the loading of the page. Suppose that you put the above code at the top of the page; when the current web page is loading, the first item to load is the ad code, and only when the ad- related code is loaded can the page be rendered. Obviously, this should be avoided, or it may make the page seem slow to load and even "dead," which is of course converse of the original idea of the website owner. Thus, it's highly suggested that the ad code be put at the far bottom of the page, which will not tamper with the normal loading and rendering of the page even if the ad code cannot be shown.

    Figure 3 indicates one of the run time snapshots of the in-text advertising application in use.


    Figure 3-the in-text advertising application in use

    Next, let's start to resolve the architecture of the application system.

    System Architecture

    In this case, for readers to gain a clearer insight into the system, we'll first illustrate the related architecture diagram, as shown in Figure 4 below.


    Figure 4-the rough architecture of the system

    As you've seen, the in-text ad application is a typical three-tier system. Moreover, it's a client-centric  application with lots of client-side JavaScript programming.

    Next, it's also necessary to look at the folder structure of the website, as shown in Figure 5 below.


    Figure 5-the file and folder structure of the website

    For more details about the roles and functions of each of the files in Figure 5, please refer to the Table 1 listed below.


    Table 1-the detailed explanation of the system files

    File Name

    Note

    App_DataAD.mdf

    The database of the system

    App_Codesql.cs

    Encapsulates the database-related operations

    App_Codetools.cs

    Encapsulates an encrypting method

    App_CodevalidateCode.cs

    The class that generates the verifying code-related picture, which provides two methods to generate the random number and verifying code

    Jsad.js

    The core code of the in-text system-generates the in-text ads and renders them

    Jsxmlhttp.js

    Encapsulates the AJAX related client-side manipulations

    Jsgetad.js

    Encapsulates the ad code for the website host to invoke conveniently

    Ad.ashx

    The handler that acquires the specified keyword-related ad contents

    adArray.ashx

    The handler that acquires the keyword array

    Admin1.aspx

    Manages the ad keywords

    Admin2.aspx

    Manages the ad keywords-related contents

    Gif.aspx

    The page responsible for generating verifying code

    Login.aspx

    The login page for the website owner and the administrator

    Redirect.aspx

    The navigating page relating the ad contents, used to record ad data

    siteUser.aspx

    The user center of the website owner related page

    Test.aspx

    The illustrative page on which to place ad code


    Next, we'll shift our attention to the database design.

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - Adding Content to a Static ASP.NET Website
    - Building a Static ASP.NET Website in a Basic...
    - Develop Your First ASP.NET Website with Visu...
    - Run ASP.NET in Windows XP Home with Cassini ...
    - How to Test a Web Application
    - How to Add Code and Validation Controls to a...
    - Working in Source and Split Views to Build a...
    - How to Build a Web Form for a One-Page Web A...
    - How to Develop a One-Page Web Application
    - An ASP.NET Web Application in Action
    - Developing ASP.NET Web Applications
    - An Introduction to ASP.NET Web Programming
    - Introduction to the ADO.NET Entity Framework...
    - Completing an In-Text Advertising System und...
    - Programming an In-Text Advertising System un...





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek