ASP.NET
  Home arrow ASP.NET arrow Programming an In-Text Advertising System ...
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

Programming an In-Text Advertising System under ASP.NET 3.5
By: Xianzhong Zhu
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2009-01-21

    Table of Contents:
  • Programming an In-Text Advertising System under ASP.NET 3.5
  • The JavaScript files
  • The Server-side Programming
  • The Three Generic Handlers Related Programming

  • 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


    Programming an In-Text Advertising System under ASP.NET 3.5


    (Page 1 of 4 )

    Now, with the general requirements, architecture, and database definition in mind, in this installment, we are going to delve into the core code programming of the in-text ad system. But first of all, let’s familiarize ourselves with the invoking relationships between the files.

    The invoking relationships between the files

    According to the explanations in the first part of the series, the core of an in-text advertising system mainly focuses upon the post and rendering of the in-text ads. In this system, this is divided into six parts: the CSS files, JavaScript files, the server-side code files under folder App_Code, and three generic handlers, i.e. AdArray.ashx, AD.ashx, and redirect.ashx. For a better understanding of the invoking relationships of the six parts and related files, please refer to Figure 1 below.


    Figure 1—the invoking relationships of the fix parts

    Next, let’s research each of the six parts shown in Figure 1.

    The cascade style sheet file

    In the in-text ad system, we use the CSS file stylesheet.css to place all the style-related CSS code, where the code mainly relates to the ad window definition. The following gives the related CSS code definitions:

    body {/*the general page style definition */

    font-family: Arial, Helvetica, sans-serif;

    font-size: 14px;

    line-height: 150%;

    }

    a {/*hyperlink style definition */

    color: #0000CC;

    text-decoration: underline;

    }


    .STYLE1 {color: #FF3300}

    #AdShowBoxContent p {/*the p element related style definition
    inside the ad window */

    white-space: nowrap;

    margin: 0px;

    padding-top: 3px;

    padding-bottom: 2px;

    overflow: hidden;

    width:170px;

    text-overflow:ellipsis;

    }

    #AdShowBox {/*ad window style definition*/

    background-color: whiteSmoke;

    font-size: 12px;

    line-height: 150%;

    font-family: Arial, Helvetica, sans-serif;

    border: 1px solid Red;

    display: none;

    }

    #AdShowBoxBartitle {/*the header title inside the ad window
    style definition */

    float: left;

    font-weight: bold;

    color: #0066FF;

    }

    #AdShowBoxBarClose {/* style definition for the ‘close’
    button inside the ad window*/

    float: right;

    font-size: 14px;

    font-weight: bold;

    color: #FF0000;

    }

    #AdShowBoxBar {/* the header style definition inside the ad
    window */

    background-color:menu;

    padding-top: 4px;

    padding-right: 5px;

    padding-left: 10px;

    margin-right: auto;

    margin-left: auto;

    height: 22px;

    }

    #AdShowBoxContent {/* style definition for the contents
    inside the ad window */

    padding-top: 5px;

    padding-right: 10px;

    padding-bottom: 5px;

    padding-left: 10px;

    }

    #AdShowBoxContent a {/* style definition for the a element
    inside the ad window */

    color: #0066FF;

    text-decoration: underline;

    }

    In the above CSS code, the key contents relate to the ad window and related elements' style definitions. Of course, they are also easy to understand with the embedded explanations. Well, let’s go on to check out the main JavaScript files defined in the ad system.

    More ASP.NET Articles
    More By Xianzhong Zhu


     

    ASP.NET ARTICLES

    - ASP.NET DotNetNuke Installation with Visual ...
    - Using ASP.NET with a MySQL Database
    - Using ASP.NET with an MS Access Database
    - 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





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