RadButton OnClientClicked occurs on Page_Load

2 posts, 0 answers
  1. Lynn
    Lynn avatar
    186 posts
    Member since:
    Sep 2006

    Posted 25 Dec 2014 Link to this post

    I have having a consistently wrong issue with the RadButton...When the web form is loaded, the OnClientClicked event is executing but the JavaScript fails because it can't find the function.  This is actually two (2) errors -- first the OnClientClicked event should NOT be firing and second, the javascript function it appears to be looking for is present in the code.

    I have read other similar threads and they all say to remove the () after the function name in the OnClientClicked event property -- but I have done that repeatedly.  The button definition, the javascript function, and a screen capture of the javascript error are all included.
    <telerik:RadButton ID="CreateNew" runat="server" Text="Create New" CausesValidation="False" ToolTip="Displays a form for adding a new Master Agent Billing set to the database." UseSubmitBehavior="false" OnClick="CreateNew_Click" OnClientClicked="makeNew" />

    function makeNew(sender, eventArgs) {
        document.getElementById('<%= HiddenField1.ClientID%>').value = "myTarget;
        document.getElementById('<%= K.ClientID%>').value = "0";
        document.getElementById('<%= KI.ClientID%>').value = "0";
        document.getElementById('<%= KII.ClientID%>').value = "0";
        document.getElementById('<%= M.ClientID%>').value = "N";
        document.getElementById('<%= MI.ClientID%>').value = "N";
        document.getElementById('<%= MII.ClientID%>').value = "N";

  2. Ianko
    Ianko avatar
    1738 posts

    Posted 26 Dec 2014 Link to this post

    Hello Lynn,

    This question seems related to your previously opened thread (RadButton OnClientClicked Firing on Page_Load), let us continue the conversation there.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top