Isn't there going to be a performance hit as well? You are loading hover menu for each occurance of a row (in case of GridView, DataList, etc,). Won't it be bettor to fire an event in case the user hovers over a control?.
Thanks
I love computers because: MY WISH IS THEIR COMMAND :)
Yes, you are adding an additional control for each row. However, the extender controls don't render any HTML so there isn't any added payload.
The scenario doesn't change whether you have one extender or 10 of them - there is a separate instance of the behavior attached to each target control (e.g. the panel in this case). It's that behavior that listens for the mouse over events on the elements
you're tracking.
Don't forget, this posting is provided "AS IS" with no warranties, and confers no rights.
The panels being loaded are briefly displayed during page load or refresh. They then are hidden. Is there any way to stop them from being displayed for a split second?
Thanks
I love computers because: MY WISH IS THEIR COMMAND :)
Yes, you are adding an additional control for each row. However, the extender controls don't render any HTML so there isn't any added payload.
The scenario doesn't change whether you have one extender or 10 of them - there is a separate instance of the behavior attached to each target control (e.g. the panel in this case). It's that behavior that listens for the mouse over events on the elements
you're tracking.
It not just the question of adding additional controls upfront wirh no HTML rendered. Consder the following scenario:
You have a GridView with 100 rows. On each row, you have 3 HoverMenuExtender. For each of the HoverMenuExtender, you are populating the control by doing a DB read. So upfront you have done 100 x 3 = 300 reads. Instead of that, if you had a property in th HoverMenuExtender
that would call a method on the server, you would do just one read as opposed to 300.
Thanks
I love computers because: MY WISH IS THEIR COMMAND :)
I have a small javascript function (similar to your example above) that creates and attaches a HoverMenuBehavior. Everything works perfectly fine, except I keep getting a javascript error saying
'Type' is not defined referring to the first line in HoverMenuBehavior.js:
Type.registerNamespace('AtlasControlToolkit');
Do I need to include another .js file somewhere other than
HoverMenuBehavior.js?
My code is functioning exactly how I want, but the error is annoying.
You need to make sure you've got the scripts for the "Atlas" runtime as well. This is accomplished most easily by including a
ScriptManager control on the page.
Thanks,
Ted
This posting is provided "AS IS" with no warranties, and confers no rights.
As you can see, I'm even using a web service for an ajax call which is also working fine. That's the disturbing part... it all *seems* fine. I've even (for now) commented out the offending line and everything is still working.
Are you manually including the Toolkit script that's causing the error? The
ScriptManager does a lot of work to make sure all the scripts come down to the client in the right order. That's the only thing I can think of off the top of my head. If this doesn't apply, maybe you could post a small sample outlining the problem.
Thanks,
Ted
This posting is provided "AS IS" with no warranties, and confers no rights.
sburke_msft
Contributor
4396 Points
770 Posts
Microsoft
Re: Creating Atlas Controls
May 08, 2006 10:10 PM|LINK
You need to add the extender as well:
pnlHover.Parent.Controls.Add(hme)
yaip
Contributor
4785 Points
1229 Posts
Re: Creating Atlas Controls
May 08, 2006 10:27 PM|LINK
I love computers because: MY WISH IS THEIR COMMAND :)
<Website>
<Gadget>
sburke_msft
Contributor
4396 Points
770 Posts
Microsoft
Re: Creating Atlas Controls
May 08, 2006 11:08 PM|LINK
Yes, you are adding an additional control for each row. However, the extender controls don't render any HTML so there isn't any added payload.
The scenario doesn't change whether you have one extender or 10 of them - there is a separate instance of the behavior attached to each target control (e.g. the panel in this case). It's that behavior that listens for the mouse over events on the elements you're tracking.
yaip
Contributor
4785 Points
1229 Posts
Re: Creating Atlas Controls
May 08, 2006 11:34 PM|LINK
I love computers because: MY WISH IS THEIR COMMAND :)
<Website>
<Gadget>
sburke_msft
Contributor
4396 Points
770 Posts
Microsoft
Re: Creating Atlas Controls
May 09, 2006 04:19 PM|LINK
yaip
Contributor
4785 Points
1229 Posts
Re: Creating Atlas Controls
May 09, 2006 06:27 PM|LINK
It not just the question of adding additional controls upfront wirh no HTML rendered. Consder the following scenario:
You have a GridView with 100 rows. On each row, you have 3 HoverMenuExtender. For each of the HoverMenuExtender, you are populating the control by doing a DB read. So upfront you have done 100 x 3 = 300 reads. Instead of that, if you had a property in th HoverMenuExtender that would call a method on the server, you would do just one read as opposed to 300.
I love computers because: MY WISH IS THEIR COMMAND :)
<Website>
<Gadget>
mwadden
Member
25 Points
5 Posts
Re: Creating Atlas Controls
Jul 19, 2006 07:10 PM|LINK
I have a small javascript function (similar to your example above) that creates and attaches a HoverMenuBehavior. Everything works perfectly fine, except I keep getting a javascript error saying 'Type' is not defined referring to the first line in HoverMenuBehavior.js:
Type.registerNamespace('AtlasControlToolkit');
Do I need to include another .js file somewhere other than HoverMenuBehavior.js?
My code is functioning exactly how I want, but the error is annoying.
Thanks for the help,
-mark
Ted Glaza [M...
Contributor
4198 Points
847 Posts
Microsoft
Re: Creating Atlas Controls
Jul 20, 2006 11:50 PM|LINK
You need to make sure you've got the scripts for the "Atlas" runtime as well. This is accomplished most easily by including a ScriptManager control on the page.
Thanks,
Ted
mwadden
Member
25 Points
5 Posts
Re: Creating Atlas Controls
Jul 21, 2006 02:44 AM|LINK
<atlas:ScriptManager id="MasterScriptManager" EnablePartialRendering="true" runat="Server" EnableScriptComponents="True" EnableScriptGlobalization="false">
<services>
<atlas:servicereference path="~/Admin/AssetManager.asmx" />
</services>
</atlas:ScriptManager>
As you can see, I'm even using a web service for an ajax call which is also working fine. That's the disturbing part... it all *seems* fine. I've even (for now) commented out the offending line and everything is still working.
Very strange.
Ted Glaza [M...
Contributor
4198 Points
847 Posts
Microsoft
Re: Creating Atlas Controls
Jul 21, 2006 05:50 PM|LINK
Are you manually including the Toolkit script that's causing the error? The ScriptManager does a lot of work to make sure all the scripts come down to the client in the right order. That's the only thing I can think of off the top of my head. If this doesn't apply, maybe you could post a small sample outlining the problem.
Thanks,
Ted