ASP.NET AJAX Always Visible Control Frustrations

by Donn Felker 17. July 2007 08:47

Unfortunately I don't have time to go through and figure out why the Always Visible control wont work with a user control. Although I assume it has something to do with the HTML DOM. Some relationship in there is probably hard coded or assumed.

Here's what I was trying to do:

I want to have an always visible control that had some items in it (lets say a bunch of links). I wanted that to be in a user control. I wanted that user control to be the "always visible" control. So I set the TargetID to the user control and ... NO DICE. Doesn't work. I get a cannot load behavior ID or something like that. Its a JavaScript error, and I could figure it out if I had time, but unfortunately the project I'm on doesn't permit.

I even attempted to get around this by putting all of the ASP.NET AJAX into a user control and then add the user control to the page. NOPE, didn't work.

Solution

This is kind of a hacky solution, but it works. You can get this to work by putting all of your controls into a user control. Then wrap your user control in a panel. Like so:

<ajaxToolkit:AlwaysVisibleControlExtender
    ID="avce" runat="server"
    VerticalSide="bottom"
    TargetControlID="scrollingPanel"
    VerticalOffset="10"
    HorizontalSide="Right"
    HorizontalOffset="10"
    ScrollEffectDuration=".1" />
<asp:Panel runat="server" ID="scrollingPanel">
    <uc1:MyUserControl ID="myUc" runat="server"  />
</asp:Panel>

This will allow you to still use a user control, but in my opinion, its kind of hacky. If and when I find time to work around this I'll post an update. If anyone else knows of a fix, please let me know.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

AJAX | ASP.NET

Add comment


(Will show your Gravatar icon)  

  Country flag

biuquote
  • Comment
  • Preview
Loading



Powered by BlogEngine.NET 1.4.5.0
Theme by Mads Kristensen

About the author

Donn Felker

Senior Consultant
MCTS
ScrumMaster
Agile Practitioner

About Me | Books I Recommend

Gotta Pay The Bills


Tag cloud

    Popular Posts

    RecentComments

    Comment RSS

    Calendar

    <<  January 2009  >>
    MoTuWeThFrSaSu
    2930311234
    567891011
    12131415161718
    19202122232425
    2627282930311
    2345678

    View posts in large calendar