This is a migrated thread and some comments may be shown as answers.

Server-side PostBack in RadAjaxManager UpdatedControls

2 Answers 298 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
T
Top achievements
Rank 1
T asked on 07 Sep 2010, 02:53 PM
Hi,

I've got a FormView (insert mode only) with an ObjectDataSource. I want to split the FormView into several "pages", controlled by a RadTabStrip (hiding panels, showing selected panel). Works perfectly! In the last panel I want to show the submit button for the FormView. The submit button should be not ajaxified doing a server postback.

How do I do a server-side postback inside an updated control?
Did I understand the concept of the RadAjaxManager right?

Thanks,
Toby

relevant code (ASPX):
<!-- form view --->
           <asp:FormView ID="QuestionnaireFormView" runat="server"  
                DataSourceID="QuestionnaireObjectDataSource" DefaultMode="Insert"
                DataKeyNames="Id">
                <InsertItemTemplate>
                <asp:Panel ID="Panel1" runat="server" CssClass="questionnairepanel">
                 [...]
                </asp:Panel>
                <asp:Panel ID="Panel2" runat="server" CssClass="questionnairepanel">
                 [...]
                </asp:Panel>
                </InsertItemTemplate>
            </asp:FormView>

<!-- submit button --->
            <div id="div_insertbutton" runat="server" class="div_buttons">
                <asp:Button ID="InsertButton" runat="server" CausesValidation="True" CommandName="Insert" AlternateText="Submit" Text=Submit" CssClass="submitbutton" />
            </div>

<!-- tab strip --->
<telerik:RadTabStrip ID="RadTabStripQuestionnaire" runat="server" CssClass="rctabstrip"  
                    ontabclick="RadTabStripQuestionnaire_TabClick" AutoPostBack="True"
                    SelectedIndex="1">
                    <Tabs>
                        <telerik:RadTab runat="server" Text="Question 1-3"  Value="1" CssClass="rctab" SelectedCssClass="rctab_selected" Selected="True">
                        </telerik:RadTab>
                        <telerik:RadTab runat="server" Text="Question 4-8" Value="2" CssClass="rctab" SelectedCssClass="rctab_selected">
                        </telerik:RadTab>
                        [...]
                    </Tabs>
</telerik:RadTabStrip>

<!-- ajax manager --->
    <telerik:RadAjaxManager runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadTabStripQuestionnaire">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadTabStripQuestionnaire" />
                    <telerik:AjaxUpdatedControl ControlID="div_insertbutton" />
                    <telerik:AjaxUpdatedControl ControlID="Panel1" />
                    <telerik:AjaxUpdatedControl ControlID="Panel2" />
                     [...]
                 </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

relevant code (CS):
        protected void RadTabStripQuestionnaire_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
        {
            currentpanel = e.Tab.Value;
            HideShowPanels(currentpanel);
        }

        private void HideShowPanels(string currentpanel)
        {
            [...]
            // in last panel show submit button
            div_insertbutton.Visible = true;
        }


2 Answers, 1 is accepted

Sort by
0
Accepted
Iana Tsolova
Telerik team
answered on 07 Sep 2010, 03:49 PM
Hi,

You need to handle the RadAjaxManager OnRequestStart client-side event and there disable ajax in case the submit button is clicked. You can find the above solution described in section 1. (Disable ajax in the OnRequestStart client-side event handler of the RadAjaxManager control for the particular postback) of this help topic.

Sincerely yours,
Iana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
T
Top achievements
Rank 1
answered on 07 Sep 2010, 05:40 PM
Hi Iana,

thanks! That did the trick!

Went for solution 2 of the help topic...

Toby
Tags
Ajax
Asked by
T
Top achievements
Rank 1
Answers by
Iana Tsolova
Telerik team
T
Top achievements
Rank 1
Share this question
or