Refresh Parent - Load On Demand

8 posts, 1 answers
  1. Orest
    Orest avatar
    31 posts
    Member since:
    Apr 2009

    Posted 21 Oct 2009 Link to this post

    I need to do something similar to that you have in this example

    http://demos.telerik.com/aspnet-ajax/tooltip/examples/loadondemand/defaultcs.aspx but imagine that in the control that embedded in a tooltip is an update control and I’m changing product name, so after I finished updating my fields I need to refresh my parent page. How do I do that? I’m using the same control tree similar to what you have in your example.

    1. Have a parent page (user control)
    2. Have a telerik:RadListBox that is bound and on ItemDataBound I add TargetControls collection
    3. On OnAjaxUpdate I instantiate my “Update User Control”.  I have “Save” button on it so when action is taken in “Update” control I need to refresh my Parent page with new info
  2. Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 23 Oct 2009 Link to this post

    Hi Orest,

    I already answered your other thread and for your convenience and for others who might have the same question I pasted my reply below:


    There is no way to achieve what you want without using an additional update panel and this is not directly related to RadControls but to the way AJAX works. Let me explain in brief what is actually happenning in your case. The link button is inside the RadToolTip and since this is a LOD AJAX tooltip, this means that all teh tooltip content is in an update panel and this button is a trigger for updating this update panel. This means that when you click the button, you update only this part of the page which is inside the tooltip. In order to update another part of the page you should wrap it also in an update panel because this is how update panels work - if an update panel is updated, only this part of the page gets updated. This being said, the only possible solution is to also update the other part ofg the page you need by using another update panel.

    I hope that my explanation is detailed enough and clear, let me know if you have additional questions.


    Regards,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Orest
    Orest avatar
    31 posts
    Member since:
    Apr 2009

    Posted 23 Oct 2009 Link to this post

    I was able to make this work. I have my content that needs to be updated in a different Update panel. Add Event to my Control and subscribed for that event in the parent.
    ctlProduct.ActionCommandClick += this.prodMenu_Click; 
     so when Save button is clicked event is raised by control and after parent receives is I change content and do UpdatePanel2.Update
  5. Answer
    Svetlina Anati
    Admin
    Svetlina Anati avatar
    2795 posts

    Posted 26 Oct 2009 Link to this post

    Hello Orest,

    Indeed, your solution will also work but actually what it is doing is that it calls the Update() method of the update panel. Furthermore, if you have other custom code in the handler it will also get excecuted despite the menu item was not actually clicked which is not wanted in most cases. However, in case this works for you and  you prefer this solution you can stick to it.


    Sincerely yours,
    Svetlina
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Francis Frank
    Francis Frank avatar
    35 posts
    Member since:
    Mar 2010

    Posted 25 Oct 2011 Link to this post

    Please can someone help me 

    I have a tooltip which contains a button
    I want to refresh the parent page when i click on the button inside the tooltip
  7. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 26 Oct 2011 Link to this post

    Hi Francis,

    You can do this easily by using the client-side click handler of the button and calling window.location.reload(), for example:
    <asp:Button ID="Button1" Text="reload page" OnClientClick="window.location.reload(); return false;" runat="server" />



    Regards,
    Marin
    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
  8. Francis Frank
    Francis Frank avatar
    35 posts
    Member since:
    Mar 2010

    Posted 28 Oct 2011 Link to this post

    Thanks Marin,

    Your quick response was so satisfying - I appreciate

    But I need to do this after executing some server side codes
    May I get a solution that works from code behind file?

    Thanks Marin, Thanks Telerik Team
  9. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3596 posts

    Posted 28 Oct 2011 Link to this post

    Hi Francis,

    If you need the server-side functionality I advise that you inject a script from the server that will do the same as my previous example. An example how do to this is available in the following help article: http://www.telerik.com/help/aspnet-ajax/radwindow-troubleshooting-javascript-from-server-side.html. Please note the section related to AJAX - the usage of the ScriptManager's RegisterStartupScript() method. I propose this, as Reseponse.Redirect() cannot work with partial page updates, so you can redirect the browser only on the client in this case.


    Kind regards,
    Marin
    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
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017