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

Radbutton still can click after disabled

5 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dylan
Top achievements
Rank 2
Dylan asked on 02 Sep 2013, 02:21 AM

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

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 Sep 2013, 04:52 AM
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.
0
Dylan
Top achievements
Rank 2
answered on 02 Sep 2013, 07:03 AM
Hi Shinu,

I'm getting below error.

Compiler Error Message: BC30456: 'RadButton2_Click' is not a member of 'ASP.webform44_aspx'.
0
Shinu
Top achievements
Rank 2
answered on 03 Sep 2013, 04:34 AM
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.
0
Ravikarthik
Top achievements
Rank 1
answered on 17 Nov 2016, 02:39 PM
I am able to reproduce the issue. The issue happens only in IE ( version I have is 11) and not in Chrome
0
Rumen
Telerik team
answered on 17 Nov 2016, 03:54 PM
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.
Tags
General Discussions
Asked by
Dylan
Top achievements
Rank 2
Answers by
Shinu
Top achievements
Rank 2
Dylan
Top achievements
Rank 2
Ravikarthik
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or