Two AsyncUpload on one page - problem with enabled property

2 posts, 0 answers
  1. Michal
    Michal avatar
    2 posts
    Member since:
    Jun 2012

    Posted 05 Jun 2012 Link to this post

    Hello

    I'm using ASP.NET AJAX Q1 2012 version. When I put two RadAsyncUpload on one page, and try to set enabled property on false, i receive some JavaScript error. It's working when there is only one RadAsyncUpload control. 

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            </telerik:RadScriptManager>
      
            <telerik:RadAsyncUpload ID="RadAsyncUpload1" runat="server">
            </telerik:RadAsyncUpload>
      
            <telerik:RadAsyncUpload ID="RadAsyncUpload2" runat="server">
            </telerik:RadAsyncUpload>

    namespace test1
    {
        public partial class WebForm1 : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                RadAsyncUpload1.Enabled = false;
                RadAsyncUpload2.Enabled = false;
            }
        }
    }

    error

  2. Plamen
    Admin
    Plamen avatar
    2958 posts

    Posted 07 Jun 2012 Link to this post

    Hello Michel,

     Thank you for reporting this issue.

    This is an already known bug in RadAsyncUpload and and I have increased its fixing priority. You can observe its status and vote for it at our Pits here.

    Please excuse us for this inconvenience. Meanwhile if you want to enable and disable the second RadAsyncUpload in the code behind you can use a hidden fields value and the code below:

    <script type="text/javascript">
          function pageLoad() {
              var async = $find("<%= RadAsyncUpload2.ClientID %>");
              if (document.getElementById('<%= HiddenField1.ClientID %>').value == "true") {
                  async.set_enabled(false);
              }
          }
      </script>
      <div>
          <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload1">
          </telerik:RadAsyncUpload>
          <telerik:RadAsyncUpload runat="server" ID="RadAsyncUpload2">
          </telerik:RadAsyncUpload>
      </div>
      <telerik:RadButton runat="server" ID="RadButton1" Text="disableSecondUpload" OnClick="RadButton1_Click">
      </telerik:RadButton>
      <asp:HiddenField runat="server" ID="HiddenField1" />
    protected void RadButton1_Click(object sender, EventArgs e)
       {
           HiddenField1.Value = "true";
       }


    Hope this will be helpful. 


    Greetings,
    Plamen Zdravkov
    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.
Back to Top