Rad Upload inside Ajax ModalPopupExtender

3 posts, 1 answers
  1. Rajiv Prashant
    Rajiv Prashant avatar
    16 posts
    Member since:
    Oct 2009

    Posted 15 Nov 2010 Link to this post

    HI,

    I have a Requirement that  Rad Upload inside Ajax Modal Popup Extender.
    when i implementing  i getting radupload.uploadfiles.count is 0 (Zero).

    Following is the  Aspx code .

                    <asp:UpdatePanel ID="updHead" runat="server">
                        <ContentTemplate>
    <Ajax:ModalPopupExtender ID="mpeRespond" runat="server" TargetControlID="lblRespond"
                                    BackgroundCssClass="modalBackground" PopupControlID="divRespond" CancelControlID="lblRespond"
                                    DynamicServicePath="" Enabled="True" />
                                <asp:Label ID="lblRespond" runat="server" meta:resourcekey="lblRespondResource1"></asp:Label>
                                <div id="divRespond" style="display: none; width: 60%;" runat="server" class="popup">
                                    <div class="popUpTitle">
                                        <asp:Label ID="lblResponseHead" runat="server" Text="Response" meta:resourcekey="lblResponseHeadResource1"></asp:Label></div>
                                    <div class="popupContent">
                                        <div class="infoContainer">
                                            <div class="infoContent">
                                                <span class="mandetory">*</span> Indicates Mandatory Fields.</div>
                                        </div>
                                        <asp:Label ID="lblmsg" runat="server" Visible="False" ForeColor="Red" Font-Bold="True"
                                            meta:resourcekey="lblmsgResource1"></asp:Label>
                                        <span class="mandetory">*</span>
                                        <asp:Label ID="lblShortDesc" runat="server" CssClass="formLabelL" meta:resourcekey="lblShortDescResource1">Short Description : </asp:Label><br />
                                        <asp:RegularExpressionValidator ID="revSubject" runat="server" ControlToValidate="txtShortdesc"
                                            ValidationExpression="[^<>]+" ErrorMessage="Short Description <br/> should not contain '<' '>'"
                                            Display="None" Width="600px" ValidationGroup="Mandatory" meta:resourcekey="revSubjectResource1"></asp:RegularExpressionValidator>
                                        <asp:RequiredFieldValidator ID="rfvShortdesc" runat="server" ControlToValidate="txtShortdesc"
                                            ErrorMessage="Enter<br/>Response<br/>Short<br/>Description" Display="None" ValidationGroup="Mandatory"
                                            meta:resourcekey="rfvShortdescResource1"></asp:RequiredFieldValidator>
                                        <Ajax:ValidatorCalloutExtender ID="vceShortdesc1" runat="server" TargetControlID="revSubject"
                                            Enabled="True">
                                        </Ajax:ValidatorCalloutExtender>
                                        <Ajax:ValidatorCalloutExtender ID="vceshored2" runat="server" TargetControlID="rfvShortdesc"
                                            Enabled="True">
                                        </Ajax:ValidatorCalloutExtender>
                                        <asp:TextBox ID="txtShortdesc" runat="server" Height="50px" TextMode="MultiLine"
                                            MaxLength="140" Width="90%" ToolTip="Enter Short Description For Your Response"
                                            TabIndex="1" onKeyDown="textCounter(140)" onKeyUp="textCounter(140)" meta:resourcekey="txtShortdescResource1"></asp:TextBox>
                                        <div class="info">
                                            <input id="count" readonly="readonly" runat="server" type="text" maxlength="3" value="140"
                                                class="mybox" style="text-align: right;" />
                                            characters left</div>
                                            <asp:UpdatePanel runat ="server" UpdateMode="Always" ><ContentTemplate >
                                        <div>
                                            <table>
                                                <tr align="left" id="trlnkAttach" runat="server">
                                                    <td style="background: #f6f4eb; border-top: 1px solid #e8e8e5;">
                                                    </td>
                                                    <td valign="top" style="text-align: right; background: #f6f4eb; border-top: 1px solid #e8e8e5;">
                                                        <img style="border-width: 0px;" src="../App_Themes/Default/Images/Icons/attachment.png" alt ="Click Here To Attach Files"><asp:LinkButton
                                                            ID="lnkAttach" runat="server" Text="Attach Files" ToolTip="Click Here To Attach Files"
                                                            TabIndex="4"></asp:LinkButton>
                                                    </td>
                                                </tr>
                                                <tr id="trupload" align="right" runat="server" visible="true">
                                                    <td style="background: #f6f4eb;">
                                                    </td>
                                                    <td valign="top" style="text-align: left; padding: 2px; background: #f6f4eb;">
                                                        <asp:Panel runat="server" ID="pnlRadUpload">
                                                            <table cellpadding="2" cellspacing="0" border="0">
                                                                <tr align="left">
                                                                    <td align="left">
                                                                        <telerik:RadUpload ID="RadUploadAttachs" ReadOnlyFileInputs="True" Skin="Outlook"
                                                                            runat="server" TabIndex="5" Width="600px" OnValidatingFile="RadUploadAttachs_ValidatingFile"
                                                                            OnClientFileSelected="checkExtension" ControlObjectsVisibility="RemoveButtons, AddButton"
                                                                            InputSize="55">
                                                                            <Localization Select="Browse" />
                                                                        </telerik:RadUpload>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td style="background: #f6f4eb;">
                                                                        &nbsp;
                                                                    </td>
                                                                </tr>
                                                                <tr align="left">
                                                                    <td align="left" style="background: #f6f4eb;">
                                                                      
                                                                           <asp:Label ID="lblFileInfo" Text="Files Information :" runat="server" meta:resourcekey="lblFileInfoResource1"></asp:Label></span>
                                                                           
                                                                    </td>
                                                                </tr>
                                                                <tr align="left">
                                                                    <td align="left" style="background: #f6f4eb;">
                                                                        <span style="color: #333; font-size: 11px;">
                                                                            <asp:Label ID="lblUpdInfo" runat="server" Width="600px" meta:resourcekey="lblUpdInfoResource1"></asp:Label></span>
                                                                    </td>
                                                                </tr>
                                                            </table>
                                                        </asp:Panel>
                                                        <Ajax:CollapsiblePanelExtender runat="server" ID="AjaxCPE" TargetControlID="pnlRadUpload"
                                                            CollapseControlID="lnkAttach" ExpandControlID="lnkAttach" Collapsed="True" CollapsedSize="0"
                                                            ExpandedText="Attach Files" TextLabelID="lnkAttach" SuppressPostBack ="true"   Enabled="True">
                                                        </Ajax:CollapsiblePanelExtender>
                                                    </td>
                                                </tr>
                                            </table>
                                        </div>
                                        </ContentTemplate></asp:UpdatePanel>
                                        <asp:Label ID="lblLongDesc" runat="server" CssClass="formLabelL" meta:resourcekey="lblLongDescResource1">Detailed Description : </asp:Label><br />
                                        <custom:CustomEditor ID="txtLongDesc" runat="server" NoScript="True" AutoFocus="False"
                                            TabIndex="2" ToolTip="Enter Detailed Decription For Your Response" meta:resourcekey="txtLongDescResource1">
                                        </custom:CustomEditor>
                                    </div>
                                    <div class="popBtn">
                                        <div class="popBtnContent">
                                            <asp:Button ID="btnSave" runat="server" Text="Save" ValidationGroup="Mandatory" ToolTip="Click Here To Save"
                                                TabIndex="3" OnClick="btnSave_Click" CssClass="button" meta:resourcekey="btnSaveResource1" />
                                            <asp:Button ID="btnCancel" runat="server" Text="Cancel" CssClass="cancelBtn" CausesValidation="False"
                                                ToolTip="Click Here To Cancel" TabIndex="4" OnClick="btnCancel_Click" meta:resourcekey="btnCancelResource1" />
                                        </div>
                                    </div>
                                </div>
                            </div>
      </ContentTemplate>
                    </asp:UpdatePanel>


  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 15 Nov 2010 Link to this post

    Hello Rajiv,

    In order for an upload to occur it needs to perform a full postback, not an ajax one. This help topic should be of use.

    http://www.telerik.com/help/aspnet-ajax/ajax-force-controls-to-postback.html

    You need to exclude the button that initiates the upload to not use ajax.

    I hope that helps.
  3. Answer
    Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 15 Nov 2010 Link to this post

    Or you may consider using our RadAsyncUpload as a replacement for RadUpload (if applicable).

    Best regards,
    Sebastian
    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
Back to Top