Rad Numeric Text onBlur

3 posts, 0 answers
  1. Vatsal
    Vatsal avatar
    26 posts
    Member since:
    Oct 2010

    Posted 05 Mar 2013 Link to this post

    Scenario:
    1. Have one user control (ucControl1.ascx)
    2. Have below numeric text box with onBlur client event in ucControl1.ascx
      <tr>
                              <td>
                      Number:
                              </td>
                              <td>
                                  <telerik:RadNumericTextBox ID="txtNumber" runat="server" Type="Number"
                                      NumberFormat-DecimalDigits="0">
                                      <ClientEvents OnBlur="OnBlur" />
                                  </telerik:RadNumericTextBox>
                                  <script type="text/javascript">
                                      function OnBlur(sender, args) {
                                          alert('Hello');
                                      }
                                  </script>
                              </td>
                          </tr>
    3. Usercontrol is visible=false on page load.
    4. Usercontrol get visible dynamically from page on some event.
    5. Getting error "Error: 'OnBlur' is undefined" when I set visible=true for user control (i.e. ascx) from submit button click event
    6. I am using RadAjaxManager for all post back. Have also put user control in ajax manager setting. Please see below
      <telerik:AjaxSetting AjaxControlID="btnSubmit">
                      <UpdatedControls>
                              <telerik:AjaxUpdatedControl ControlID="ucControl1" LoadingPanelID="radAjaxLoadingPanel" />
                      </UpdatedControls>
      </telerik:AjaxSetting>

    Can you please help me in this? It's urgent for me...

    Thanks,
    Vatsal

  2. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 05 Mar 2013 Link to this post

    Hello,

    Please remove below JS code from UserControL and add this in to PAGE (where you this called usercontrol ).
     
    <script type="text/javascript">
                                    function OnBlur(sender, args) {
                                        alert('Hello');
                                    }
                                </script>

    Because if we used UpdatePanel/RadAjaxMaanger in USerControl then it will render the JS in page. Thats why you have to add this JS code in page.

    Thanks,
    Jayesh Goyani
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Vatsal
    Vatsal avatar
    26 posts
    Member since:
    Oct 2010

    Posted 05 Mar 2013 Link to this post

    Hmmm... I think I have to put js in page itself. But one problem is I am reading value from one or more controls in user control using ClientID. I have to get those ids in page...

    Ok thanks, Let me check. I just wanted to know if I am missing anything from my side.
Back to Top