Change Control Dynamically

Oct 21, 2008 at 12:52 PM
Hi' I am trying to load the ascx control dynamically via javascript based on a variable but when I attempt to change the control, I get a Failed to load viewstate. "The control tree into which viewstate is being loadedmust match the control tree that was used to save viewstate during the previousrequest..." Is it possible to change the ascx control using  set_UserControlPath()? If so how? Anyone Please. 
Coordinator
Oct 22, 2008 at 8:59 AM
Hi mobetta,

using set_UserControlPath() is the correct way.
If you changed the user control, you have to clear the ViewState of the old one. Unfortunally I have to method to achieve this.
I'll put your request to the Issue Tracker and add this functionality to the next release.

Regards,
Stefan
Nov 9, 2008 at 5:13 PM
Thanks Stefan
I look foward to the next release. Great work.
MB


--- On Wed, 10/22/08, iucon wrote:
From: iucon
Subject: Re: Change Control Dynamically [PartialUpdatePanel:38134]
To: nguijoel@yahoo.com
Date: Wednesday, October 22, 2008, 3:59 AM

#yiv1460847730 {font-family:Verdana;font-size:0.75em;}#yiv1460847730 #ThreadNotificationFooter{border-top:1px solid #ccc;color:gray;}#yiv1460847730 #ThreadNotificationPostBody{Margin-Bottom:2em;} #yiv1460847730 {font-family:Verdana;font-size:0.75em;}#yiv1460847730 #ThreadNotificationFooter{color:gray;border-top:1px solid #ccc;}#yiv1460847730 #ThreadNotificationPostBody{Margin-Bottom:2em;}
From: iucon
Hi mobetta,

using set_UserControlPath() is the correct way.
If you changed the user control, you have to clear the ViewState of the old one. Unfortunally I have to method to achieve this.
I'll put your request to the Issue Tracker and add this functionality to the next release.

Regards,
Stefan

Coordinator
Nov 13, 2008 at 4:10 PM
Hi mobetta,

the new release is now online.
Be sure to set the property EncryptUserControlPath to false if you want to change the path dynamically.

Regards,
Stefan
Dec 1, 2008 at 11:44 AM
Thanks Stefan! I will check it out.

Regards
Mobetta


--- On Thu, 11/13/08, iucon <notifications@codeplex.com> wrote:

> From: iucon <[email removed]>
> Subject: Re: Change Control Dynamically [PartialUpdatePanel:38134]
> To: [email removed]
> Date: Thursday, November 13, 2008, 11:10 AM
> From: iucon
>
> Hi mobetta,
>
> the new release is now online.
> Be sure to set the property EncryptUserControlPath to false
> if you want to change the path dynamically.
>
> Regards,
> Stefan
>
>