v
Not logged inv
SearchAsk a QuestionReport an IssueMake a SuggestionMy Questions and Issues
Issue Details
Find By ID

usercontrol inside a callbackpanel

Issue Details

Log in to Track Changes or Edit
Q204086
Question
FloridaDevs
Yes
Processed
Answered
.NET (ASP.NET)
n/a
9.1.2
Windows Server 2003
Microsoft Visual Studio 2005
5/1/2009 5:00:30 PM
-> Created by FloridaDevs 4/28/2009 9:52:20 PM

I have a usercontrol inside a callbackpanel that I'm trying to pass a parameter to.
In "UserControl":
    public string ClientID
    {
        get { return ViewState["ID"].ToString(); }
        set { ViewState["ID"] = value; }
    }

On the callback:
UserControl.ID = value;

The value does not make the usercontrol. Any ideas?

<- Reviewed by DevExpress Team 4/28/2009 10:38:33 PM
-> Updated by FloridaDevs 4/29/2009 5:54:00 PM

It is my understanding that the ViewState requires a postback and I'm using a callback. Do you have a suggestion for an alternative method?

<- Processed (Answered) by DevExpress Team 4/29/2009 10:56:01 PM

Hello Charles,

Sorry for the delay in responding. Unfortunately, your real task is unclear for us. Could you please tell us what you are doing? Only then can we give you an alternative solution or a suggestion.
Regarding the information you gave us, there is no way to force an update to viewstate on callbacks.
Viewstate for a page control tree is loaded after the OnInit event and viewstate is saved after the pre-render event. Any attempts to modify a control before the OnLoad event will be overwritten by viewstate. Any attempts to modify a control after the pre-render event will be lost. The control life cycle exists so that data can be loaded and saved in a predicable manner. There is no way to change this behavior.

Thanks,
Dennis

-> Reactivated by FloridaDevs 4/30/2009 2:33:23 PM

My real task is to hide or show a detailview and aspxgridview depending on a selection made another gridview through an update panel. Currently I'm using an updatepanel which posts the entire page when there is no need. The detailview and aspxgridview are in seperate webusercontrols because they are used else where in my application. Both require a parameter to be passed to bind the correct company information to the detail and or aspxgridview. When I was using the update panel ViewState did the trick but as I said I'm trying to get away from this. Question being, if there is no way to force an update of the viewstate through a callback, might you suggest a better way of passing the webusercontrol a parameter and rebinding it?

<- Processed (Answered) by DevExpress Team 5/1/2009 5:00:30 PM

Hello,

Thanks for the clarification, and sorry for the delay in responding. I am glad that you have a working solution to this problem via the UpdatePanel. However, why can't you use session variables to make an exchange by parameters?
If this doesn't meet your needs, I suggest you ask a question on specific ASP.NET forums, because this problem seems to be more general, and outside the bounds of our products. Hopefully, you will get helpful feedback, or other alternatives.

Thanks,
Dennis

Log in to Track Changes or Edit
v
v
Search
Searching Tips