asp:adrotator KeywordFilter issue

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
11/18/2011 7:03:46 AM
Gravatar
Total Posts 38

asp:adrotator KeywordFilter issue

I built a simple webusercontrol which locates an asp:adrotator which I placed in my layout.master file, and binds it to a datatable.

The keyword filter works in my development environment but not as a mojoPortal "Feature"

The adrotator otherwise functions as expected (ImageUrl and NavigateUrl fields bind correctly and images rotate as desired).  However the KeywordFilter property doesn't  filter. 

The data field name is "Keyword", so that looks correct.  

I am not using the mojoPortal adrotator

I assign the keywordfilter property just before databinding.

I have enabled the viewstate property on the asp:adrotator control.

I would appreciate any comments or clues on where else I might look....

 

Thanks,

 

Ken

11/18/2011 7:09:26 AM
Gravatar
Total Posts 18439

Re: asp:adrotator KeywordFilter issue

Set breakpoints and step through the code and see what is happening, I suspect it is a matter of timing of events.

Also if I were implementing that I would put the ad rotator inside your usercontrol and embed the usercontrol in layout.master, that way you have a direct reference to the ad rotator and don't have to go fishing for it in layout.master and you can be sure that since it is a child control of your usercontrol its pageload event won't fire until after your usercontrol pageload fires.

Hope that helps,

Joe

11/21/2011 5:58:53 AM
Gravatar
Total Posts 38

Re: asp:adrotator KeywordFilter issue

Thanks for your reply.

To debug the problem of the adrotator KeywordFilter not being applied, I dropped  an asp:adrotator directly into my layout.master file, setting all required properties in markup, and dispensing with any custom code via webusercontrol.  The markup appears at the bottom of the post.

On the home page -- the one delivered with the site with prompt "Edit this page" or what have you, the filter is applied reliably.  On any other page it is unreliable.

This question is now academic as I'm moving to a parameter based approach and will filter desired records via the data layer.  

_____________________________

Here's the markup

 

<form id="frmMain" runat="server">
   <asp:Adrotator ID="adrotator1" runat="server" AdvertisementFile="ads.xml" EnableViewState="true" KeywordFilter= "vertical"  />
   ...

 

_________________________

and the xml file

 

_________________________

 

<?xml version="1.0" encoding="utf-8" ?> 
<Advertisements xmlns="http://schemas.microsoft.com/AspNet/AdRotator-Schedule-File"> 
  <Ad> 
    <ImageUrl>/Data/Sites/2/ads/adhorizontal.jpg</ImageUrl> 
    <NavigateUrl>http://www.sourceasp.net</NavigateUrl> 
    <AlternateText>banner ad 1</AlternateText> 
    <Keyword>horizontal</Keyword> 
    <Impressions>100</Impressions> 
    <Width>500</Width> 
    <Height>140</Height> 
  </Ad> 
 
  <Ad> 
    <ImageUrl>/Data/Sites/2/ads/advertical.jpg</ImageUrl> 
    <NavigateUrl>http://www.sourceasp.net</NavigateUrl> 
    <AlternateText>banner ad 2</AlternateText> 
    <Keyword>vertical</Keyword> 
    <Impressions>100</Impressions> 
    <Width>130</Width> 
    <Height>400</Height> 
  </Ad> 
   
 
 
</Advertisements>

 

 

 

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