textbox keypress event not working in RadAjaxManager

9 posts, 0 answers
  1. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 10 Oct 2010 Link to this post

    my webpage have two input control that is textbox &  search button. i wrote  textbox keypress event javascript .
    if i try to type keywords in textbox, the keypress event is firing and then click search button control .again i try  to type keywords in textbox the keypress event not firing..

    Hope u could understand what i meant, plz help me..


    this is my code:


    <head id="Head1" runat="server">
     
    </head>
    <body>
        <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnableScriptGlobalization="True">
         <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />    
        </Scripts>
    </asp:ScriptManager>
      
      <script type="text/javascript">
        window.$ = $telerik.$;
        $(document).ready(function() {
            var typeDelay = function(){
                var timer = 0;
                return function(callback, ms){
                   clearTimeout (timer);
                   timer = setTimeout(callback, ms);
                
            }();
             
            $("#query").keypress(function(){
            
                   // your ajax search here, with a 300 ms delay...   
                   typeDelay(function(){
                    
                   alert('controls comes here.!'); 
                    
                    }, 300);
            });
        }); 
      
     </script>
    <telerik:RadAjaxManager id="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <ajaxsettings>
                  <telerik:AjaxSetting AjaxControlID="RadAjaxPanel1">
                    <UpdatedControls>
                                   <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel1" />  
                    </UpdatedControls>
                </telerik:AjaxSetting>                
      </ajaxsettings>
    </telerik:RadAjaxManager>
     
    <telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" Runat="server" Skin="Default"  Width="100%"></telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" Width="100%">
             <asp:TextBox ID="query" MaxLength="100" runat="server" />
            <asp:Button ID="btnSubmit" runat="server" Text="Search" />
                    
            </telerik:RadAjaxPanel>
        </form>
    </body>
    </html>
  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 11 Oct 2010 Link to this post

    Hello,

    Please note that using the both Ajax controls 9radAjaxmanager and radAjaxPanel0 into one application for updating the same part of the page is not supported scenario. Please replace the RadAjaxPanel with regular asp Panel container and verify if this makes any difference.


    Kind regards,
    Maria Ilieva
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 11 Oct 2010 Link to this post

    i tried with normal panel control  instead of RadAjaxPanel but same problem occur..
  4. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 14 Oct 2010 Link to this post

    Hello,

    Please note that the RadAjaxPanels should be replaced by asp panel not to add the asp Panels in them.

    Kind regards,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 17 Oct 2010 Link to this post

    radajaxpanel  replaced  with asp panel but same problem occure.can you send me sample working code?

    this is modified code:
    <telerik:RadAjaxManager id="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
        <ajaxsettings>
                  <telerik:AjaxSetting AjaxControlID="pnlTest">
                    <UpdatedControls>
                                   <telerik:AjaxUpdatedControl ControlID="pnlTest" />  
                    </UpdatedControls>
                </telerik:AjaxSetting>                
      </ajaxsettings>
    </telerik:RadAjaxManager>
     
    <telerik:RadAjaxLoadingPanel id="RadAjaxLoadingPanel1" Runat="server" Skin="Default"  Width="100%"></telerik:RadAjaxLoadingPanel>
     
      
     <asp:Panel runat="server" ID="pnlTest"
             <asp:TextBox ID="query" MaxLength="100" runat="server" />
            <asp:Button ID="btnSubmit" runat="server" Text="Search" />  
     </asp:Panel>


  6. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 25 Oct 2010 Link to this post

    Hi,

    Please find attached a sample application which shows the correct behavior of keypress event after the search button initiate a callback. Let me know if it works for you.

    Kind regards,

    Maria Ilieva
    the Telerik team

     

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 25 Oct 2010 Link to this post

    hi  

    its great.now its working fine . but i have one question 

    1.  why my code is not working .but i found one different in your code that's you have created event in vb side  code
    "query.Attributes.Add("onkeypress", "test()");" but i created event in  client side using document ready

    why  this "$("#query").keypress" event not working  in client side using jquery (document ready)

    This my Code:
        <script type="text/javascript">
       window.$ = $telerik.$;
       $(document).ready(function() {
           var typeDelay = function(){
               var timer = 0;
               return function(callback, ms){
                  clearTimeout (timer);
                  timer = setTimeout(callback, ms);
               }
           }();
             
           $("#query").keypress(function(){
            
                  // your ajax search here, with a 300 ms delay...  
                  typeDelay(function(){
                    
                  alert('controls comes here.!');
                    
                   }, 300);
           });
       });
      
    </script>

      
  8. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 29 Oct 2010 Link to this post

    Hello,

    The problem is that calling the script into document. ready is too early for the RadAjax to initialize its settings. Therefore I would suggest you to call the script into the Page Load event on the client in order to have this work as expected.


    Kind regards,
    Maria Ilieva
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. nanthakumar thangavel
    nanthakumar thangavel avatar
    27 posts
    Member since:
    Nov 2009

    Posted 29 Oct 2010 Link to this post

    Hello Maria Ilieva ,

    Thanks for your Great Support.Now its working fine with my code
Back to Top