Rad Upload control does not store the file in desire Location

1 posts, 0 answers
  1. Deepak
    Deepak avatar
    9 posts
    Member since:
    Aug 2010

    Posted 27 Dec 2010 Link to this post

    Hi ,
    I am new in rad control.
    I am using rad upload control in our asp.net page and try to store the file in our project folder by TargetFolder property of rad upload.
    Here is my page code is.
    <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        </telerik:RadScriptManager>
        <div class="fromContainer">
            <h1>
                <asp:Label runat="server" ID="lblHeader" Text="Why I love Kiwanis" />
            </h1>
            <img src="Images/btnAdd.jpg" class="btnAdd" id="Add" />
            <div style="clear: both;">
            </div>
            <div id="panleText" class="tabPanel">
                <h2>
                    Add your story and photo here!
                </h2>
            </div>
            <div id="panelMain">
                <asp:UpdatePanel runat="server" ID="UP">
                    <ContentTemplate>
                        <div class="bottomBgBox">
                            <table cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>
                                        <table class="tblBasicForm">
                                            <tr>
                                                <td>
                                                    First Name
                                                </td>
                                                <td>
                                                    <asp:TextBox runat="server" ID="txtFirstName" CssClass="input" />
                                                </td>
                                                <td>
                                                    <asp:RequiredFieldValidator ID="rfvFirstName" runat="server" ControlToValidate="txtFirstName"
                                                        ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    Last Name
                                                </td>
                                                <td>
                                                    <asp:TextBox runat="server" ID="txtLastName" CssClass="input" />
                                                </td>
                                                <td>
                                                    <asp:RequiredFieldValidator ID="rfvLastName" runat="server" ControlToValidate="txtLastName"
                                                        ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    Club Name
                                                </td>
                                                <td>
                                                    <asp:TextBox runat="server" ID="txtClub" CssClass="input" />
                                                </td>
                                                <td>
                                                    <asp:RequiredFieldValidator ID="rfvClub" runat="server" ControlToValidate="txtClub"
                                                        ErrorMessage="*" ValidationGroup="Submit" ForeColor="Red"></asp:RequiredFieldValidator>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                    <td>
                                        <table class="tblOptionalForm">
                                            <tr>
                                                <td rowspan="3">
                                                    <img src="Images/tagOptional.jpg" />
                                                </td>
                                                <td>
                                                    Country
                                                </td>
                                                <td>
                                                    <asp:DropDownList runat="server" ID="ddlCountry" AutoPostBack="true" OnSelectedIndexChanged="ddlCountry_OnSelectedIndexChanged"
                                                        CssClass="input" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    State
                                                </td>
                                                <td>
                                                    <asp:DropDownList runat="server" ID="ddlState" CssClass="input" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    City
                                                </td>
                                                <td>
                                                    <asp:DropDownList runat="server" ID="ddlCity" CssClass="input" OnSelectedIndexChanged="ddlCity_OnSelectedIndexChanged" />
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div class="discriptionBox">
                            Discription
                            <br />
                            <asp:TextBox CssClass="input" runat="server" ID="txtDiscription" TextMode="MultiLine" />
                            <asp:RequiredFieldValidator ID="rfvDescription" ControlToValidate="txtDiscription" ErrorMessage="*" ForeColor="Red"
                                runat="server" ValidationGroup="Submit"></asp:RequiredFieldValidator>
                            <br />
                            <div>
                                <telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="The code you entered is not valid."
                                    ValidationGroup="Submit">
                                </telerik:RadCaptcha>
                            </div>
                            <br />
                            Photo Upload
                            <br />
                            <telerik:RadUpload ID="flPhoto" runat="server" CssClass="fileUpload"  AllowedFileExtensions=".jpeg,.png,.gif"
                                ControlObjectsVisibility="None" TargetFolder="~/Record/"></telerik:RadUpload>
                            <asp:ImageButton runat="server" ID="btnUpload" CssClass="btnAdd" ImageUrl="~/Images/btnUpload.jpg"
                                OnClick="btnUpload_OnClick" ValidationGroup="Submit" />
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
           
    </asp:Content>
    In our code i am using <asp:update panel> plz provide me help by example
    1. How to use rad ajax in that particular page.
    2. why the uploaded file does not store in folder.
    Thankx
Back to Top