Adrotator Webmodule

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/11/2009 10:28:49 AM
Gravatar
Total Posts 73

Adrotator Webmodule

I implemented a custom module to display an adrotator. I took your HelloWorld example and converted it to use the ad rotator control you created. This worked fine in IE, but in FireFox it actually does not display. I found that it displays as a small hidden image. I then tried the asp.net ad rotator with the same results. This had the same results. I now think the problem lies within the browsers control adapter. With either version, I end up with "border-width: 0px; height: 175px; width: 365px; display: none;" added into the inline style of the image when it displays in FF.

<%@ Control Language="C#" ClassName="HelloMojoModule.ascx" Inherits="mojoPortal.Web.SiteModuleControl" %>
<%@ Import Namespace="System.Globalization" %>
<%@ Import Namespace="mojoPortal.Business" %>
<%@ Import Namespace="mojoPortal.Business.WebHelpers" %>
<%@ Import Namespace="mojoPortal.Web.Framework" %>
<%@ Import Namespace="mojoPortal.Web.Controls" %>
<%@ Import Namespace="mojoPortal.Web.Editor" %>
<%@ Import Namespace="mojoPortal.Net" %>

<mp:cornerroundertop id="ctop1" runat="server" />
<asp:Panel ID="pnlWrapper" runat="server" CssClass="panelwrapper htmlmodule">
<asp:UpdatePanel ID="upAds" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<portal:moduletitlecontrol id="Title1" runat="server" />
<asp:Panel ID="pnlMyClass" runat="server" CssClass="modulecontent">
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Data/Sites/1/Ads/Ads.ads" Target="_blank" Enabled="true" Width="175" Height="175" Visible="true" />
</asp:Panel>
<div class="modulefooter">
</div>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
<mp:cornerrounderbottom id="cbottom1" runat="server" />
 

 

I liked the onclick property in your ad rotator, but I require the target property that is found in the asp.net version. I also needed the ability to control the image's height and width. I guess I could have put a class on the AdRotator itself. That would however have not solved the target issue.

5/11/2009 10:41:01 AM
Gravatar
Total Posts 18439

Re: Adrotator Webmodule

Please don't report bugs in your own custom features as mojoPortal bugs. There is no Adrotator webmodule included in mojoportal. This is some problem in your implementation since you can neither get the asp:AdRotator nor the mojoportal version working.

The mojoportal adrotator control does in fact work, it is used on this site in my layout.master file to rotate ads at the bottom.

I have no idea why you can't get it working but its not a bug in mojoPortal. In the future please ask questions like this in the developer forum and maybe someone can help. I can guess it may be a problem having it inside an update panel. There is no need to wrap it in an update panel if you are not doing any postback, and as far as I know ad rotators don't do postback. Nor is there any particular reason to  wrap it in a panel or have a title control in there or corner rounders, unless you want to show a title over the ads and corner rounding around it.

Best,

Joe

5/11/2009 10:47:59 AM
Gravatar
Total Posts 73

Re: Adrotator Webmodule

Sorry about that. It is actually working, just not visible in FF because of an inline style that is getting applied. I have tried it with, and without the updatepanel, with the same results. This is how I tried it at first.

<mp:cornerroundertop id="ctop1" runat="server" />
<asp:AdRotator ID="AdRotator1" runat="server" AdvertisementFile="~/Data/Sites/1/Ads/Ads.ads"
Target="_blank" Enabled="true" Width="175" Height="175" Visible="true" style="padding-left: 5px;" />
<mp:cornerrounderbottom id="cbottom1" runat="server" />

If this post is upsetting you being in this forum, please move it. Again, I apologize if I posted in the wrong forum.
 

5/11/2009 10:58:07 AM
Gravatar
Total Posts 18439

Re: Adrotator Webmodule

We are not using any custom browser control adapter for the adrotator. I would try settting EnableTheming = false on the control as I have found that the asp.net theme system applies inline styles.

I can't think of any reason it would work differently inside a module control vs inside the layout.master and this problem does not happen for me, my ads work fine in Firefox. 

Also not sure about the style attribute you have put on the control, I don't think that is a valid property of the AdRotator, the documentation seems to indicate it is read only property.

Hope it helps,

Joe

5/11/2009 11:05:50 AM
Gravatar
Total Posts 18439

Re: Adrotator Webmodule

I don't think you can set the style declaratively on the control as you have done, you can add style attributes programatically as outlined here

The other thing is the moj AdRotator does support Target just like the built in ASP.NET one, however the target attribute is not valid in xhtml, so the runtime probably won't render it because we have it configured only to render valid xhtml by this setting in Web.config:

<xhtmlConformance mode="Strict" />

This probably blocks the rendering of the target attribute in both our control and the asp.net version. If you remove the config setting it should render the target attribute, but then your pages won't validate agaisnt the w3c validator.

Hope it helps,

Joe

 

5/11/2009 11:08:18 AM
Gravatar
Total Posts 18439

Re: Adrotator Webmodule

A better way to open in a new window is adding javascript code in the OnClientClick to open it in a new window. 

5/11/2009 11:21:37 AM
Gravatar
Total Posts 73

Re: Adrotator Webmodule

Ok, wow I owe you an apology. This turned out to be a PEBCAK issue. I forgot that I run the addon Adblock Plus in FF....  Sorry Joe.

You must sign in to post in the forums. This thread is closed to new posts.