Showing posts with label instead. Show all posts
Showing posts with label instead. Show all posts

Wednesday, March 28, 2012

How do I play the animation on control B when hovering over control A?

Hello.

When I hover over a control (in my case a menu), and I want to play the animation on a panel instead my menu, how can I do that?

This is my code so far, I just can't figure out how to change from the menu to the panel.

<asp:scriptmanager ID="Scriptmanager1" runat="server" />
<asp:Menu ID="MyMenu" runat="server" .................................. /
<div class="AnimateThis" id="AnimateThis" runat="server">
This is the text I want to play the animation on.
</div
<ajaxToolkit:AnimationExtender ID="MyAnimation" runat="server" TargetControlID="MyMenu" BehaviorID="AnimateMyText">
<Animations>
<OnHoverOver>
<FadeOut/>
</OnHoverOver>
<OnHoverOut>
<FadeIn/>
</OnHoverOut>
</Animations>
</ajaxToolkit:AnimationExtender

Hi,

Take a look at the Animation Target section of theUsing Animations walkthrough.

Thanks,
Ted


It seems I should use AminationTarget to do this. Thanks.

Monday, March 26, 2012

How do i get a ReorderList to render vertically

I need to render a ReorderList in a vertical direction instead of the standard horizontal way.

Does anybody know hoe to do this, so the control works like the RadioButtonList with a repeat direction property?

In HTML i know i can get <ul> and <ol> to render vertically using CSS, but i so far cannot duplicate this using a ReorderList.

Thanks in advance

yosh

Sorry got my directions mixed up, need list to render horizontally..

I added a line to the contructor of the BulletList class that sets the CssStyle to enable the list to render horizontally, but not an elegent way of doing things. The Bulletlist in the reorderlist class is not visible to child classes, so i will need to change the base class anyway.

Any better ideas?

How do I extend an Atlas extender?

Let's say I create my own Atlas Control Extender. For example, I create an extender called MyHoverExtender. But instead of extending Control or WebControl, I want to extend the HoverMenuExtender. But when I change it to use that, I get this error:

error BC32044: Type argument 'SearchResultItem.MyHoverExtenderProperties' does not inherit from or implement the constraint type 'Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuExtender)'.

Can anyone help me with this error?

Thanks

The extender class and the properties class have to travel in pairs. So if you derive from the extender, you need to also do so from the properties class. I think if you just have your MyHoverExtenderProperties class inherit from HoverMenuProperties you should be OK.



So here's what I've got right now:

-----------------

MyHoverExtenderDesigner.vb:

Class MyHoverExtenderDesigner
Inherits Microsoft.AtlasControlExtender.Design.ExtenderControlBaseDesigner(Of MyHoverExtenderProperties, AtlasControlToolkit.HoverMenuExtender)
End Class

Produces this error:

error BC32044: Type argument 'SearchResultItem.MyHoverExtenderProperties' does not inherit from or implement the constraint type 'Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuExtender)'.

-----------------

MyHoverExtenderExtender.vb:

<Assembly: System.Web.UI.WebResource("SearchResultItem.MyHoverExtenderBehavior.js", "text/javascript")>

<System.ComponentModel.Designer(GetType(MyHoverExtenderDesigner))> _
<Microsoft.AtlasControlExtender.ClientScriptResource("MyHoverExtender", "MyHoverExtenderBehavior", "SearchResultItem.MyHoverExtenderBehavior.js")> _
Public Class MyHoverExtenderExtender
Inherits Microsoft.AtlasControlExtender.ExtenderControlBase(Of MyHoverExtenderProperties, AtlasControlToolkit.HoverMenuExtender)
End Class

Produces this error:

error BC32044: Type argument 'SearchResultItem.MyHoverExtenderProperties' does not inherit from or implement the constraint type 'Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuExtender)'.

-----------------

MyHoverExtenderProperties.vb

<System.ComponentModel.DefaultProperty("MyProperty")> _
Public Class MyHoverExtenderProperties
Inherits Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuProperties)

Public Property MyProperty() As String
Get
Return GetPropertyStringValue("MyProperty")
End Get
Set(ByVal value As String)
SetPropertyStringValue("MyProperty", value)
End Set
End Property

End Class

This file builds without any errors as far as I can tell.


Oh, sorry, just find my problem.

The MyHoverExtenderProperties class was declared thusly:

Public Class MyHoverExtenderProperties
Inherits Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuProperties)

But it should be declared:

Public Class MyHoverExtenderProperties
Inherits Microsoft.AtlasControlExtender.TargetControlPropertiesBase(Of AtlasControlToolkit.HoverMenuExtender)


That's closer. Does that work?

I think you actually want:

public class MyHoverExtender inherits HoverMenuExtender

public class MyHoverExtenderProperties inherits HoverMenuProperties

What you have above says that you'll be extending controls of type HoverMenuExtender, which I don't think you want.


Yeah, I think you're right. I'm in the process of confusing myself today between wanting to extend my own custom control using a modified version of the hover extender. I think I've almost got my head around it all.

:) Okay if you want more help confusing yourself, just let us know and we'll be glad to lend a hand.

Seriously, our refresh should help with this - I'm concerned you may run into some issues getting the right scripts to load as is. I haven't tried what you're doing so do let us know.

Saturday, March 24, 2012

How can I use bridging with AutoCompleteExtender?

I would like to use external webservice to get data in AutoCompleteExtender instead of having local .txt file as specified in ATLAS documentation/exmples.

.asbx is correctly registered in IIS. I have created a bridge file ServerAutoComplete.asbx like...

<?

xmlversion="1.0"encoding="utf-8" ?>
<bridgenamespace="Samples.AspNet"className="BridgeServerAutoComplete" >
<proxytype="CatalogReader, App_Code" />
<methodname="GetWordList">
<input>
<parametername="prefixText"/>
<parametername="count" />
</input>
</method>
</bridge>

where CatalogReader is class of my webservice which is hosted on another server.

I have following settings in my ServerAutoComplete.aspx page forScriptManagerandAutoCompleteExtender.

<atlas:ScriptManagerID="AtlasPage1"runat="server">
<Services>
<atlas:ServiceReferencePath="~/ServerAutoComplete.asbx"/>
</Services>
</atlas:ScriptManager>

...

<

asp:TextBoxID="TextBox1"runat="server"></asp:TextBox>

<atlas:AutoCompleteExtenderID="autoComplete1"runat="server">
<atlas:AutoCompletePropertiesEnabled="True"MinimumPrefixLength="1"ServiceMethod="GetWordList"ServicePath="ServerAutoComplete.asbx"TargetControlID="TextBox1"/>
</atlas:AutoCompleteExtender>

...

Now when I run ServerAutoComplete.aspx page I am not getting any AutoComplete words.

My question is how can I set this whole set-up working? How can I set parameters of webservice method from AutoCompleteProperties?

Am I missing any step?

Thanks,

Vishant

Hi Vishant,

So the easiest way for you to pass parameters to the bridge in this scenario would be on the query string.

First you'll need to enable get for your bridge service, which you can do by adding:

<methodname="GetWordList" getEnabled="true">

Now you can hit the bridge using a url like: http:yourserver/ServerAutoComplexe.asbx?mn=GetWordList&prefixText=<text>&count=<count>, you should verify that using the browser and make sure that you get some JSON back...

That being said, I'm not sure there's an easy to pass these on the query string from AutoComplete. The best option would be to add a <binding> for the serviceUrl of the autocompleteproperteries where you specify a custom javascript transform method, i.e. transform="GetServiceUrl", and this method returns "ServerAutoComplete.asbx?prefixText="+document.getElementById("TextBox1").value and you also add the count parameter in there as well.

That should work, I think...

Hope that helps,
-Hao


Hi Hao,

Thanks for your reply.

I enabled "get" on my bridge service as you have mentioned but when I hit browser with "http:yourserver/ServerAutoComplexe.asbx?mn=GetWordList&prefixText=<text>&count=<count>" it does not give any JSON. Is this the exact syntax should I use?

I also could not find</binding>tag anywhere in documentation. Is this new tag forAutoCompleteProperties? I put it as shown below but no result.Does this syntax is correct?

<atlas:AutoCompletePropertiesEnabled="True"MinimumPrefixLength="1"ServiceMethod="GetWordList"ServicePath="~/ServerAutoComplete.asbx"TargetControlID="TextBox1">
<bindingtransform="GetServiceUrl"></binding>
</atlas:AutoCompleteProperties>

I know I am asking too much but I am new to ATLAS and JSON. It would be great if you can please provide step by step instruction or syntax?

Vishant


So you'll want to hit the real URL of your server with the browser, not http:yourserver..., you'll also want to give real data to your service.

Taking a step back, what is does your ServerAutoComplete.asbx look like?

But the real situation is that currently the AutoCompleteExtender does not really have a good story for hitting a bridge rather than an explicit webservice as its expecting, the option I listed above is more of a workaround/hack given the existing situation.

Hope that helps,
-Hao