Sometime it is hard to manage adsense ads with asp.net project. The primary problem is that suppose sometimes we want to change ad or off the ad, asp.net project need a recompilation. Here is solution to this problem.
Like given in above figure, I have added a Ad Script folder and inside this folder I have added different control files for different ads. Suppose I have add a text ad of 250x250 , for this ad we can give file name as Text250x250.ascx. put your adsense code inside these ascx file. One ad one file. Note that for ascx file content change we do not need a recompilation of whole source code. Just change the contents of this file and everything is done.
Here is code to add ascx file into aspx page:
<%@ Register Src="Ad Script/Text250x250.ascx" TagName="Text250x250" TagPrefix="uc4" %>
Now you need to add this control file to you original page and deploy the code.
:)
0 comments:
Post a Comment