Click here to Skip to main content
15,900,378 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I try to write a simple Server Control to control the Banners in my site.

It should be somethink like:

C#
<Banners:mng_bnr ID="Upper_bnr / aside_bnr / bottom_bnr / etc"  runat="server" /> 


And then the Control will be something like:
C#
<%@ Control Language="C#" %> 
 
<script  runat="server"> 
 
 protected void Page_Load(object sender, EventArgs e) 
 { 
 
 
 switch(which_banner) 
 { 
 case which_banner.upper_banner_wide:  
<!-- Ad code --> 
 <script type="text/javascript"><!-- 
JS code 
 </script> 
 <script type="text/javascript" 
 
 </script> 
 <!-- *** Ad Code *** -->  
break; 
 
case which_banner.upper_banner_small: 
 <!-- Ad code --> 
 <script type="text/javascript"><!-- 
JS code 
 </script> 
 <script type="text/javascript" 
 
 </script> 
 <!-- *** Ad Code *** -->  
break; 
 
case which_banner.aside_336_280_top: 
 
 <!-- Ad code --> 
 <script type="text/javascript"><!-- 
JS code 
 </script> 
 <script type="text/javascript" 
 
 </script> 
 <!-- *** Ad Code *** --> 


But, I don't know how to get and handle the ID of each control (there should be around 5-6 controls on each page which every one will have it own ID - which mean different banner)

Thanks a lot.
Posted
Updated 8-Aug-12 7:46am
v2
Comments
Christian Amado 8-Aug-12 17:03pm    
Do you know that you can use a control called AdRotator for banners?

1 solution

May be you can read this[^]

More infoin :
MSDN page

Hope you can find this very useful.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900