How to disable remove button from the RadUpload

Thread is closed for posting
5 posts, 2 answers
  1. Akki
    Akki avatar
    79 posts
    Member since:
    Nov 2011

    Posted 15 Mar 2012 Link to this post


    Hi ,
    I want only add,delete button in RadUpload. how can i achieve this ?

    Regards,
    Akki
  2. Answer
    Kevin
    Kevin avatar
    360 posts
    Member since:
    Jul 2012

    Posted 15 Mar 2012 Link to this post

    Hello Akki,

    Here's how you can make it only show the add/delete buttons. You'll also need the checkboxes, in order for the delete to work.

    <telerik:RadUpload ID="RadUpload1" runat="server" 
            ControlObjectsVisibility="CheckBoxes, AddButton, DeleteSelectedButton">
        </telerik:RadUpload>

    I hope that helps.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 15 Mar 2012 Link to this post

    Hello Akki,

    You can disable the "Remove" button from client side.
    • Hook the pageLoad event.
    Javascript:
    function pageLoad()
       {
           $telerik.$(".ruRemove").attr("disabled", "disabled");
       }
     
    Thanks,
    Princy.
  5. Akki
    Akki avatar
    79 posts
    Member since:
    Nov 2011

    Posted 15 Mar 2012 Link to this post

    Thanks Kevin.. it worked.

    Now i have problem is uploading a file.

     <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="CheckBoxes, AddButton, DeleteSelectedButton">
      </telerik:RadUpload>
      <div style="width:100%" align="center">
    <asp:Button ID="btnUpload" runat="server" Text="Upload" onclick="btnUpload_Click"  />

        protected void btnUpload_Click(object sender, EventArgs e)
        {
            if (RadUpload1.UploadedFiles.Count > 0)
            {
                string filename = Path.GetFileName(RadUpload1.UploadedFiles[0].GetName());
                RadUpload1.TargetFolder = Server.MapPath("~/");
       
            }
        }



    but with above code.. the selected file is not getting uploaded in server path. Do i need to do anything more ? 
    Please suggest.

    Regards,
    Akki

  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 12 Aug 2013 Link to this post

    Hi Akki,

    Simply setting the TargetFolder property is not sufficient to save the files on the server. Please check the following code.

    C#:
    protected void btnUpload_Click(object sender, EventArgs e)
    {
        if (RadUpload1.UploadedFiles.Count > 0)
        {
            string filename = Path.GetFileName(RadUpload1.UploadedFiles[0].GetName());
            RadUpload1.TargetFolder = Server.MapPath("~/");
            RadUpload1.UploadedFiles[0].SaveAs(Path.Combine(RadUpload1.TargetFolder, filename));
        }
    }

    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017