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

textbox keypress event not working in RadAjaxManager

8 Answers 201 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
nanthakumar thangavel
Top achievements
Rank 1
nanthakumar thangavel asked on 10 Oct 2010, 01:37 PM
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>

8 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 11 Oct 2010, 02:34 PM
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
0
nanthakumar thangavel
Top achievements
Rank 1
answered on 11 Oct 2010, 05:29 PM
i tried with normal panel control  instead of RadAjaxPanel but same problem occur..
0
Maria Ilieva
Telerik team
answered on 14 Oct 2010, 12:56 PM
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
0
nanthakumar thangavel
Top achievements
Rank 1
answered on 17 Oct 2010, 09:51 AM
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>


0
Maria Ilieva
Telerik team
answered on 25 Oct 2010, 09:19 AM
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
0
nanthakumar thangavel
Top achievements
Rank 1
answered on 25 Oct 2010, 09:47 AM
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>

  
0
Maria Ilieva
Telerik team
answered on 29 Oct 2010, 10:01 AM
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
0
nanthakumar thangavel
Top achievements
Rank 1
answered on 29 Oct 2010, 11:23 AM
Hello Maria Ilieva ,

Thanks for your Great Support.Now its working fine with my code
Tags
Ajax
Asked by
nanthakumar thangavel
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
nanthakumar thangavel
Top achievements
Rank 1
Share this question
or