ASP.NET Adrotator Control Repeating For Length of Entire Page -


I am creating a website for which ads are being repeated under the length of the page with dynamic length, I want to Ads will be displayed in the entire length of the page, but I do not know the information until after the data is displayed. Does this have functionality in .NET? If not, can anyone see me doing this to work?

Thank you!

I think the end-of-page end-users get the ads after being sung on the browser You will be the best solution to this problem by calling back on the server (by AJAX).

You can do this, depending on your convenience, many technologies (AJAX.Net and update panels, plain-old-javascript, or web like JS or JS Framework Service with a web service) depends on your convenience.

+ ASHX option, you can do the following:

In Javascript:

  // When document $ (document) is loaded . With an altitude height = $ ("#content container") of content, make an AJAX request to MyHandler.ashx. Height () $ .get ("MyHandler.ashx? Contentheight =" + Height, response callback);} // Ad container function Response put server response (data) in response callback ($ "(" # AdCo ntainer ") HTML (data).}  
< P> In HTML:

  & lt; body & gt; & lt; div id = "contentcontainer" & gt; ... ... & lt; / div & gt; & lt ; Div id = "AdContainer"> 

MyHandler.ashx:

  Public Nil Project Request (HTTP reference reference) {HttpRequest request = context.Request; HttpResponse response = context.intpose; Int height = Convert.ToInt32 (request.QueryString ["contentheight"] ?? "0"); // Number of ads Do something to calculate and get HTML for the ad // Let's say that there is a list of our ad items: List & lt; Advert & gt; Ads = GetSomeAds (height); Foreign Advertising (Advertise in Advertising) {response.Write (a.GetHtml ()); }}  

Obviously that is the most integrated UpdatePanel option with asp.net, although I suggest that you have .ASHX (custom handler) or .asmx (web services) server side But is it more transparent and easy to know "what is this code doing?" Update panels can look like black magic.


Comments