RadUpload and radalert within Asp:updatepanel

Thread is closed for posting
2 posts, 0 answers
  1. Audy
    Audy avatar
    1 posts
    Member since:
    Dec 2011

    Posted 13 Dec 2011 Link to this post

    Hi,

    My current projects need me to do some attachment upload and validate it whether it uploaded or not. my current validation is on server side where the validation will call radalert to notify user from serverside after the message stored on db and file saved to server. 

    My issue here is the form need to be done within update panel and of course to do upload in update panel it is set to fullpostback on upload event. Why the radlert won't show after being called from server side after a full postback??

    This is my update panel snippet :
    <tr><td>Attachment(s)</td><td class="btnUpload">
                <telerik:radupload id="ruImage" runat="server" controlobjectsvisibility="RemoveButtons, AddButton" maxfilesize="5120000" >  <localization add="Add image" /> </telerik:radupload>
                </td></tr>
                        </asp:panel>
                        <asp:panel id="pnlMessageResult" runat="server">
                            <tr>
                                <td colspan="2">
                                    <asp:label id="lblMessageNote" runat="server" forecolor="Black" />
                                </td>
                            </tr>
                        </asp:panel>
                        <tr>
                            <td colspan="2">
                                <span class="btnAccept">
                                    <asp:linkbutton id="lbSend" runat="server" text="Send" onclick="lbSend_Click" /></span>
                                <span class="btnReject">
                                    <asp:linkbutton id="lbContactCancel" runat="server" text="Close" onclick="lbContactCancel_Click" /></span>
                            </td>
                        </tr>
                    </table>
                </contenttemplate>
            </asp:updatepanel>

    and this is a snippet for callback :

            if (ruImage.UploadedFiles.Count > 0)
            {
                UploadAttachment(thread.MessageThreadId);
            }
            MessageThreadController.ADD(thread);
            pnlMessageResult.Visible = true;
            pnlMessage.Visible = false;
            lbSend.Visible = false;
            }
            else
            {
               
                throw new Exception("Upload validation failed");
            }
        }
        catch (Exception ex)
        {
            validationShow(ex.Message, "Missing fields.");
        }
    }
     
    protected void validationShow(string message, string title)
    {
        RadValidationManager.RadAlert(message, 300, 40, title, "alertCallBackFn");
    }


    Thanks folk!
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 16 Dec 2011 Link to this post

    Hi Audy,

    I've prepared a sample page implementing a scenario similar to your, please find it attached. As for your problem could you check whether there are any java script errors received?

    Regards,
    Dimitar Terziev
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top