0

I've run into a problem while using Telerik RadDock control for asp.net ajax. I'm generating the dock layout dynamically and there are multiple page configurations retrieved from the database. The thing is that I need to use post data before handling LoadDockLayout event, because there is a dropDownList which gives the ability to select one of avialable configurations.

I may be missing something, but it appears to me that LoadDockLayout event is fired before PreLoad event (it looks like the LoadDockLayout is fired before ProcessPostData method call) and before dropDownList selectedIndexChanged event, so I don't have the value I need to initialize dock layout properly.

I was thinking of converting my dropDownList to client side control and passing the selected value in query string, but it seems for me to be an ugly solution. Any advices would be appreciated.

Thanks in advance.

1 Answer 1

1

The RadDockLayout.LoadDockLayout event is fired at Page.InitComplete before any post data can be handled. If you want to load different controls based on a DropDownList selected item, you can do it by checking the parameters sent from the client. Here is an example on how you can retrieve them:

ASPX

<asp:Label ID="Label1" EnableViewState="false" runat="server" />
<asp:DropDownList ID="Dropdownlist1" runat="server" AutoPostBack="true">
    <asp:ListItem Text="text1" Value="val1" />
    <asp:ListItem Text="text2" Value="val2" />
    <asp:ListItem Text="text3" Value="val3" />
    <asp:ListItem Text="text4" Value="val4" />
</asp:DropDownList>

C#

protected void Page_Init(object sender, EventArgs e)
{
    if (IsPostBack)
    {
        var selValue = this.Request.Params.Get("Dropdownlist1");
        Label1.Text = "EVENTTARGET: " + this.Request.Params.Get("__EVENTTARGET") + "<br/>Value sent: " + selValue;
    }
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.