Writing javascript code in every page of my site using aspx

A

Antonio

Good Morning,
I would want to use aspx to write this javascript code for me in every
page of my site www.etantonio.it how can I do this ???


<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXX";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = ["B4D0DC","A8DDA0","578A24"];
google_color_bg = ["ECF8FF","EBFFED","CCFF99"];
google_color_link = ["0000CC","0000CC","00008B"];
google_color_url = ["008000","008000","00008B"];
google_color_text = ["6F6F6F","6F6F6F","000000"];
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Thanks


Ing. Antonio D'Ottavio
(e-mail address removed)
www.etantonio.it
 
J

John Saunders

Antonio said:
Good Morning,
I would want to use aspx to write this javascript code for me in every
page of my site www.etantonio.it how can I do this ???


<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXX";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = ["B4D0DC","A8DDA0","578A24"];
google_color_bg = ["ECF8FF","EBFFED","CCFF99"];
google_color_link = ["0000CC","0000CC","00008B"];
google_color_url = ["008000","008000","00008B"];
google_color_text = ["6F6F6F","6F6F6F","000000"];
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>

You can create yourself a class derived from System.Web.UI.Page, and have
that class write the script during OnPreRender. You can have all of your
aspx pages derive from this base class.

I haven't tried this, but I believe you can specify a base type for all your
pages in web.config:

<configuration>
<system.web>
<pages pageBaseType="type">
</system.web>
</configuration>--
John Saunders
johnwsaundersiii at hotmail
 
F

Fritz

Antonio said:
Good Morning,
I would want to use aspx to write this javascript code for me in every
page of my site www.etantonio.it how can I do this ???


<script type="text/javascript"><!--
google_ad_client = "pub-XXXXXXXXXXXX";
google_ad_width = 728;
google_ad_height = 90;
google_ad_format = "728x90_as";
google_ad_channel ="";
google_color_border = ["B4D0DC","A8DDA0","578A24"];
google_color_bg = ["ECF8FF","EBFFED","CCFF99"];
google_color_link = ["0000CC","0000CC","00008B"];
google_color_url = ["008000","008000","00008B"];
google_color_text = ["6F6F6F","6F6F6F","000000"];
//--></script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>


Thanks


Ing. Antonio D'Ottavio
(e-mail address removed)
www.etantonio.it
Several ways, among them an clientside include file, a document.write call,
etc.
 
M

Mr. Dot Net

The best way to do common processing is using inheritance.
You can create a base class called MySitePage which inherits from
System.Web.UI.Page
in it you can write java script registration code and every other commom
processing logic.
All the pages in your site must inherit this base class.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top