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

Two AsyncUpload on one page - problem with enabled property

1 Answer 33 Views
AsyncUpload
This is a migrated thread and some comments may be shown as answers.
Michal
Top achievements
Rank 1
Michal asked on 05 Jun 2012, 09:28 AM

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

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 07 Jun 2012, 01:45 PM
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.
Tags
AsyncUpload
Asked by
Michal
Top achievements
Rank 1
Answers by
Plamen
Telerik team
Share this question
or