Disable and enable Ajax request

5 posts, 0 answers
  1. Jack
    Jack avatar
    127 posts
    Member since:
    May 2003

    Posted 02 Jul 2009 Link to this post

    Hi,

    I am making a chat app and the DataList of messages is refreshed by a timer that is ajaxed by a RadAjaxManagerProxy

    Problem is that because it is a proxy then all the controls on the page are being ajaxed and so the TextBox that the user types into is also refreshing.

    So I need to stop the timer refreshing the TextBox somehow but then enable it when the user presses 'send' so that I can clear the TextBox. Does this make any sense?

    Is this possible?

    Cheers, Jon

     


     

  2. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Jul 2009 Link to this post

    Hello Jon,

    You can use the ASP.NET AJAX timer to refresh the DataList instance only (specifying that through the RadAjaxManagerProxy settings) as illustrated on this demo with the grid:

    http://demos.telerik.com/aspnet-ajax/ajax/examples/common/ajaxifytimer/defaultcs.aspx

    Thus the user will not be interrupted when the timer triggers data list repaint. Then, through a different proxy setting, you can specify the 'Send' button as an initiator and the TextBox as one of the updated controls to reset it.

    Kind regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jack
    Jack avatar
    127 posts
    Member since:
    May 2003

    Posted 03 Jul 2009 Link to this post

    Hi Sebastion,

    Thanks for the super quick reply.
    This is how I thought it should work and in a stand alone aspx page it does work as it should.

    However, I am loading user controls dynamically into a panel and because the default.aspx page has an AjaxProxy on it which updates the panel adding the usercontrol with ajax - then everything in all the usercontrols becomes ajaxed, regardless of having an AjaxProxy on each .ascx page.

    Cheers,
    Jon

  5. Sebastian
    Admin
    Sebastian avatar
    9934 posts

    Posted 03 Jul 2009 Link to this post

    Hello Jon,

    Then the solution would be to redefine your logic and avoid ajaxifying the entire panel which hosts the user control. Thus you should use the RadAjaxManagerProxy instances inside the dynamically loaded user control to define the ajax settings as explained in my first reply. Only this way you would be able to attain the desired result.

    Best regards,
    Sebastian
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  6. Jack
    Jack avatar
    127 posts
    Member since:
    May 2003

    Posted 03 Jul 2009 Link to this post

     Hi Sebastion,

    Many thanks for your help on this and for clearing up the issue with loading inside a panel. I'll remember that for the future!

    I've decided to put the chat app inside a separate aspx page and then use an iFrame on the user control ~ It works great for this scenario.

    Cheers,

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