Enter Key in TextBox and LoadPanel

5 posts, 0 answers
  1. Dominik
    Dominik avatar
    11 posts
    Member since:
    Oct 2011

    Posted 25 Jan 2012 Link to this post

    Helo,
    On simple page I have TextBox.
    I want to associate pressing Enter key in TextBox with LoadPanel and Panel.
    When I associate TextBox in AjaxManager, nothing is happend.
    Can I please for help ?
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
     
            <telerik:AjaxSetting AjaxControlID="TextBox_autor_nazwisko">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="Panel1"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="RadNotification1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
     
        </AjaxSettings>
    </telerik:RadAjaxManager>


  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 25 Jan 2012 Link to this post

    Hello Dominik,

    Set AutoPostBack="true" for your TextBox, this will change it's behavior to make PostBack.

    Kind regards,
    Vasil
    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
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Dominik
    Dominik avatar
    11 posts
    Member since:
    Oct 2011

    Posted 26 Jan 2012 Link to this post

    Thank You Vasil,

    Yes, when I set AutoPostBack=true then LoadPanel work with Enter key.
    But it work also, when I move cursor to another TextBox on the Form.
    I'm looking for how to invoke LoadPanel ONLY after Enter key, but not after focus change.
    If the only way for working Enter key on TextBox with LoadPanel is enable AutoPostback, how I can disable PostBack when TextBox change focus to another TextBox on the Form ?
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 26 Jan 2012 Link to this post

    Dominik,

    Then you could handle the client OnKeyPress event of the RadTextBox and change the AutoPostback depending on the keyCode of the last pressed key.
    <script type="text/javascript">
      function ChangePostBackSetting(sender, eventArgs)
      {
        sender.set_autoPostBack(13 == eventArgs.get_keyCode());
      }
    </script>
    <telerik:RadTextBox runat="server" ID="RadTextBox6">
      <ClientEvents OnKeyPress="ChangePostBackSetting" />
    </telerik:RadTextBox>


    Kind regards,
    Vasil
    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
  6. Dominik
    Dominik avatar
    11 posts
    Member since:
    Oct 2011

    Posted 26 Jan 2012 Link to this post

    Thank You Vasil !

    solution working. thread can be closed.

    sorry for trivial questions :)

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017