Showing posts with label wizard. Show all posts
Showing posts with label wizard. Show all posts

Monday, March 26, 2012

Confused About AnimationExtender and UpdatePanel

Can I not use the AnimationExtender inside of an UpdatePanel?

Basically I would like to add animations to a wizard I have inside an UpdatePanel. I tried adding AnimationExtenders onto the WizardSteps but they didn't do anything.

Am I just doing it wrong, or do I need to use an UpdatePanelAnimationExtender with a lot of conditions to decide what to do on each step?

You can target a control inside an UpdatePanel from an AnimationExtender that's outside the panel. You can also give a specific control target for each action, using the AnimationTarget property.


Sounds great, however, there is a bigger problem. It appears that an AnimationExtender outside of a wizard cannot have its TargetControlID be set to a control inside of a Wizard (regardless of being in an UpdatePanel). I just get this:

The TargetControlID of 'AnimationExtender1' is not valid. A control with ID 'Button1' could not be found.

This should work, normally you can reference controls within a wizard. Is this a bug?


Do a view source on that page in your browser, find the button, and use the ID it has there. It won't be Button1, but probably something like Wizard1_something_Button1.

Or, you can probably do that programmatically, by setting the AnimationExtender1.TargetControlID to Button1.ClientID in Page_Load.


Allow me to clarify. I'm talking about this TargetControlID:

<cc1:AnimationExtender ID="AnimationExtender1" runat="server"TargetControlID="Button1">
<Animations>
<OnClick>
<Color AnimationTarget="asdf" propertyKey="backgroundColor" startValue="#FFFFFF" endValue="#000000"/>
</OnClick>
</Animations>
</cc1:AnimationExtender>

As it turns out the AnimationExtender cannot reference a TargetControlID that is inside of a wizard. This does work if the AnimationExtender and the TargetControl are inside of the same wizardstep. The UpdatePanel wasn't really my problem, it was this.


Declare the AnimationExtender with no TargetControlID in your .aspx. Then, in your Page_Load method, add AnimationExtender1.TargetControlID = Button1.UniqueID.

What happens is that your Button1 is becoming Wizard1_Button1 in the DOM of the page, so when the AnimationExtender tries to reference it with $get('Button1'), it can't find it. For whatever reason, setting it to Wizard1_Button declaratively doesn't work either. Setting it programmatically does work.


Very interesting, I'm sure I'll be using that trickSmile.

BTW, I should also note that, after testing this further, AnimationExtenders do work inside of Wizard that is inside of an UpdatePanel, my real problem was the other issue all along. Maybe this will have unexpected consequences, but its working for now.

Confirmbutton Question

I put a ConfirmButton extender for a button. This button is a submit button which is put in the last step of Wizard. The wizard has validations.

My problem is the ConfirmButton dialog doesn't pop up before the validation logic kicks in.

Any clue?

Try to set UseSubmitBehaviour property of button

For additional information

Validation controls, which includes theBaseCompareValidator,BaseValidator,CompareValidator,CustomValidator,RangeValidator,RegularExpressionValidator,RequiredFieldValidator, andValidationSummary control are not compatible with UpdatePanel

http://weblogs.asp.net/scottgu/archive/2007/01/25/links-to-asp-net-ajax-1-0-resources-and-answers-to-some-common-questions.aspx

Download compatible version of validators from here

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx

Saturday, March 24, 2012

Confirm Button Extension with Wizard buttons?

Hi

I would like to use the AJAX confirm button extension, but I am trying to attach it to the "FinishButton" that is automatically created with the ASP Wizard.

So in a nutshell when a user clicks the "finish" button in my wizard a message box will pop up asking the user if they are sure they would like to continue.

I'm using VWD2005 express and scripting in visual C#.

Please can someone help me out or point me in the right direction?

Cheers!!!

Hi

I managed to solve this one! Woooohoooo.

If anyone is interested then here's my ASP. You need to put the button extended inside the Finish Navigation Template itself.

<FinishNavigationTemplate>

<cc1:ConfirmButtonExtenderID="ConfirmButtonExtender1"runat="server"TargetControlID="FinishCompleteButton"ConfirmText="Are you sure you want to place this order?">

</cc1:ConfirmButtonExtender>

<asp:ButtonID="FinishPreviousButton"runat="server"Text="Previous"CommandName="MovePrevious"/>

<asp:ButtonID="FinishCompleteButton"runat="server"Text="Finish"OnClientClick="Wizard1_FinishButtonClick"CommandName="MoveComplete"/>

<asp:ButtonID="CancelButton"runat="server"Text="Cancel"CommandName="Cancel"/>

</FinishNavigationTemplate>