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

radUpload loadedcontrol in ajax multipage

1 Answer 43 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Pierre
Top achievements
Rank 1
Pierre asked on 05 Mar 2010, 08:20 PM
Hi,

I have many problems to fix this scenario. I need to use one radUploader usercontrol loaded in one ajax multipanel but i can't loaded my files. I have used the conditionalPostback registred from loaded usercontrols to stop ajax refreshing or created a realPostBack in page and registred in page-Load of Loaded usercontrol but still not working.

Use the wizard sample of demo of RadTabs and loading one RadUploader control
<telerik:RadAjaxLoadingPanel  runat="server" ID="LoadingPanel1" IsSticky="true"
    </telerik:RadAjaxLoadingPanel>         
    <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel1" LoadingPanelID="LoadingPanel1" > 
            <telerik:RadComboBox  runat="server" ID="RadComboTipo" Skin="Vista"  AutoPostBack="true" Width="200px" 
             OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged"  > 
                            <Items> 
                                <telerik:RadComboBoxItem Text="Select" Value="-1" Selected="true"></telerik:RadComboBoxItem> 
                                <telerik:RadComboBoxItem Text="Case1" Value="1" ></telerik:RadComboBoxItem> 
                            </Items> 
            </telerik:RadComboBox> 
            <div style="height:33px;"></div> 
            <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server" MultiPageID="RadMultiPage1" 
                Skin="Default" CssClass="tabStrip"
            </telerik:RadTabStrip> 
            <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" OnPageViewCreated="RadMultiPage1_PageViewCreated" CssClass="multiPage"
            </telerik:RadMultiPage> 
    </telerik:RadAjaxPanel> 

The LoadedControl in pageView use RadUploader and  page load to register realPostBack and stop the ajax event.

bool isOnClickAttached = false
        IEnumerator keys = this.buttonSubmit.Attributes.Keys.GetEnumerator(); 
        while (keys.MoveNext()) 
        { 
            if (keys.Current.Equals("onClick")) 
            { 
                isOnClickAttached = true
                break; 
            } 
        } 
        if (!isOnClickAttached) 
            this.buttonSubmit.Attributes.Add("onClick", string.Format("realPostBack('{0}', ''); return false;", this.buttonSubmit.UniqueID));  
 
This realpostback is firing but no upload is performed.

Use one ClientEvents-OnRequestStart="conditionalPostback" in RadAjaxPanel1 is not possible in this scenario where controls are loaded in the panel.

The object is one Ajax RadTab and one RadUpload control loaded inside and fonctional. Some suggestions. Thanks.

1 Answer, 1 is accepted

Sort by
0
Genady Sergeev
Telerik team
answered on 09 Mar 2010, 04:35 PM
Hello Pierre,

Using the conditinal postback workaround is actually possible. You can use fireBug or IE Developer tools to find out the ID of your upload button. Then, in the conditionalPostback handler compare the target id with the id of your upload button and if they match - cancel the AJAX behavior.

function conditionalPostback(sender, args)
  {
     if (args.get_eventTarget() == "your submit button ID")
     {
         args.set_enableAjax(false);
     }
}

Alternative approach is to hook on the page_load event of your user control, grab the ID of your upload button and write it to the response, like this:

ClientScript.RegisterClientScriptBlock(this.GetType(), "upload", string.Format("window['upload']={0}", "ID of your submit button"), true);


Regards,
Genady Sergeev
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.
Tags
Upload (Obsolete)
Asked by
Pierre
Top achievements
Rank 1
Answers by
Genady Sergeev
Telerik team
Share this question
or