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

RadUpload and radalert within Asp:updatepanel

1 Answer 123 Views
Upload (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Audy
Top achievements
Rank 1
Audy asked on 13 Dec 2011, 01:57 PM
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!

1 Answer, 1 is accepted

Sort by
0
Dimitar Terziev
Telerik team
answered on 16 Dec 2011, 09:50 AM
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
Tags
Upload (Obsolete)
Asked by
Audy
Top achievements
Rank 1
Answers by
Dimitar Terziev
Telerik team
Share this question
or