Showing posts with label containing. Show all posts
Showing posts with label containing. Show all posts

Monday, March 26, 2012

MultiView containing an UpdatePanel: cant switch ActiveViewIndex?

I have a button control inside of an UpdatePanel. This UpdatePanel sits inside of a MultiView control (which is NOT inside another UpdatePanel, just a regular multiview). The function that is fired from the button click is supposed to change the ActiveViewIndex, but it does not. It fires off other actions inside the function, but does not change the multiview.


Is there something I need to do to get this to work? Here is roughly what I'm talking about. In this case it's set to ActiveViewIndex = 0. I need the button to change it to index 1. Thanks!!

<asp:MultiView runat="server" ID="someID">

<asp:View runat="server"

<asp:UpdatePanel runat="server">

<contenttemplate>

<asp:Button runat="server" onclick="MyFunction" Text="CLICK ME" />

</contenttemplate>

<asp:UpdatePanel>

</asp:View>

<asp:View runat="server">

SOME LITERAL HTML CONTENT

</asp:View>
</asp:MultiView


hi rpeters,

what are you using for your MyFunction?

should be something like this, right?

multiviewAppSec.SetActiveView((

View)this.multiviewAppSec.FindControl("ViewName")));

I was simply using...

myMultiView.ActiveViewIndex = 1;



pixelsyndicate:

hi rpeters,

what are you using for your MyFunction?

should be something like this, right?

multiviewAppSec.SetActiveView((View)this.multiviewAppSec.FindControl("ViewName")));

Tried using the approach as well. No difference... :(

Anyone??


I am pretty sure I tried that before, and didn't get it to work. the definition of that property says its Sets or Gets... so it should work. Try using the

SetActiveView(view) method to make that change. You will have to pass it a reference to the View you want however. Using the findcontrol() method example I used should help you to do that. Respond back on whether it worked or not. ;)


pixelsyndicate:

I am pretty sure I tried that before, and didn't get it to work. the definition of that property says its Sets or Gets... so it should work. Try using the

SetActiveView(view) method to make that change. You will have to pass it a reference to the View you want however. Using the findcontrol() method example I used should help you to do that. Respond back on whether it worked or not. ;)

Tried it...no luck. Same result as by setting the property.


Anyone else? There has to be a way!

you stated you were using 1 as the view index to display. isn't the view you want to show actually the first view? that would mean you need to display view index ZERO (0). indexes are zero-based, meaning its it this order...

0
1
2
3
4
5
6
...


pixelsyndicate:

you stated you were using 1 as the view index to display. isn't the view you want to show actually the first view? that would mean you need to display view index ZERO (0). indexes are zero-based, meaning its it this order...

0
1
2
3
4
5
6
...

I know that they are zero-based indices. I also am using the correct view index for my application. The problem is that it seems that because it is being called from a routine that is inside of an update panel, it is trying to make the change inside that panel, rather than changing the entire page to reflect the new panel.

anyone else?? thanks.

MultiView, User Controls, PopupControlExtender

I have a webpage containing a MultiView. I put a user control in every view of the MultiView. From each user control, I use the ModalPopupExtender to open another user control, which contains fields for entering dates. I then use the calendar control and PopupControlExtender to select date.

It works fine when only one user control in the modal popup window has the calendar control and the PopupControlExtender. If more than one user controls opened with the modal popup extender have the calendar control and the PopupControlExtender, none of them works. In the latter case, I can still popup the calendar, but it doesn't allow me to select date, and it doesn't close. The calendar would dispear if I click outside the calendar area. But then I can't close the window containing the user control opened with the modal popup extender.

Anyone has similiar experience?

Please try your scenario with the recently available61020 release of the Toolkit (and ASP.NET AJAX Beta 1). If the problem persists, then please reply with acomplete, self-contained sample page that demonstrates the problem. Thank you!