Radbutton still can click after disabled

6 posts, 0 answers
  1. Dylan
    Dylan avatar
    17 posts
    Member since:
    Apr 2013

    Posted 01 Sep 2013 Link to this post


    Hi,

    All my radbutton found my application pages can be click even when it's disabled. Is it anything to do with the RadSkin that I'm using? Also my javascript popup for confirmation will still execute even when i click on the cancel button. Can anyone help me? Thanks in advance.

    Regards,
    Dylan
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Sep 2013 Link to this post

    Hi Dylan,

    Unfortunately I am not able to replicate the issue. For me the disable RadButton's Click event is not firing. This is not a skin issue because whatever skin we are using a disable Radbutton's click event will not fire. Also for the confirmation such a behavior is not expected.
    Please have a look at the following code which deals the same scenario.I am using 2 RadButton from this one is disabled. OnClick event of the First RadButton I am making the disable RadButton as Enabled. For confiramtion I am using RadConfirm.

    ASPX:
    <telerik:RadButton ID="RadButton1" runat="server" Text="DisableButton" Enabled="false"
        OnClick="RadButton1_Click" Skin="WebBlue">
    </telerik:RadButton>
    <telerik:RadButton ID="RadButton2" runat="server" Text="Click" Enabled="true"
        Skin="WebBlue" onclick="RadButton2_Click">
    </telerik:RadButton>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
    </telerik:RadWindowManager>
    <button onclick="return OpenConfirm()">
        Open radconfirm</button>

    C#:
    protected void RadButton1_Click(object sender, EventArgs e)
    {
        //disable radbutton click event
        Response.Write("<script>alert('disabled');</script>");
    }
    protected void RadButton2_Click(object sender, EventArgs e)
    {
        //making the disable radbutton as enabled
        RadButton1.Enabled = true;
    }

    JavaScript:
    <script type="text/javascript">
        function OpenConfirm() {
            radconfirm('Are you sure?', confirmCallBackFn, 330, 200, null, 'RadConfirm custom title');
            return false;
        }
        function confirmCallBackFn(arg) {
            radalert("<strong>radconfirm</strong> returned the following result: <h3 style='color: #ff0000;'>" + arg + "</h3>", 420, 220, "Result");
        }
    </script>

    Please Provide your full code if it doesn't help you.

    Thanks,
    Shinu.
  3. Dylan
    Dylan avatar
    17 posts
    Member since:
    Apr 2013

    Posted 02 Sep 2013 Link to this post

    Hi Shinu,

    I'm getting below error.

    Compiler Error Message: BC30456: 'RadButton2_Click' is not a member of 'ASP.webform44_aspx'.
  4. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Sep 2013 Link to this post

    Hi Dylan,

    When using the button control such an error can happen if you set a client side function name to a server side event handler such as OnClick. Make sure you have the server side click event defined in the code-behind with access specifier as protected. You can have a look at this forum thread which deals with the same scenario.

    Thanks,
    Shinu.
  5. Ravikarthik
    Ravikarthik avatar
    3 posts
    Member since:
    Jul 2008

    Posted 17 Nov 2016 Link to this post

    I am able to reproduce the issue. The issue happens only in IE ( version I have is 11) and not in Chrome
  6. Rumen
    Admin
    Rumen avatar
    13932 posts

    Posted 17 Nov 2016 Link to this post

    Hi Ravikarthik,

    Are you able to reproduce the problem in the following demos:
    http://demos.telerik.com/aspnet-ajax/button/examples/singleclick/defaultcs.aspx
    http://demos.telerik.com/aspnet-ajax/pushbutton/single-click/defaultcs.aspx

    If the problem is not reproducible there, my recommendation is to upgrade to the latest version R3 2016 SP2 (2016.3.1021).


    Best regards,
    Rumen
    Telerik by Progress
    Telerik UI for ASP.NET AJAX is ready for Visual Studio 2017 RC! Learn more.
Back to Top