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

RadMenu Cancel Page Request

1 Answer 71 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Dheeraj
Top achievements
Rank 1
Dheeraj asked on 11 Jun 2010, 07:30 AM
Hello,

I am using Latest Telerik ASP.Net AJAX controls in my application.Now I have some urgent requirement from Client which we need to solve. I am using RadMenu in my application. Now my problem is -

For example suppose Menu have 5 pages under it, say page's name are Page1, Page2, Page3, Page4 and Page 5.
Now when user click on Page1 from menu then suppose it takes 160 seconds to load, after that user click on Page2 which takes 45 seconds to load, and after that user click on Page5 which take 3 seconds to load.

Now if user Click on Page1 and after that he changes his mind and dont want to wait for page1 for 160 seconds, and click on page5 to see it.

My problem is that is there is any solution sothat when user click on Page from menu ,then If any previous page request is in progress for any page then cancel it, and handle only current page request.  ( For example in above case when user click on Page5 then cancel the request for Page1 and handle request for page5 only which take only few seconds to load. )

Please suggest me the solution, If my point is not clear then I can provide more detail as per the request.

Thanks,
Dheeraj Chauhan.

1 Answer, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 18 Jun 2010, 08:01 AM
Hello Dheeraj,

Thank you for the detailed description of the problem. You can use the window.stop() function to stop loading the current page and navigate to the new one immediately.

<script type="text/javascript">
    function onItemClick(sender, eventArgs)
    {
        if (window.stop) 
            window.stop();
        else
            document.execCommand("Stop"); // IE
    }
</script>
 
<telerik:RadMenu ID="RadMenu1" runat="server" EnableSelection="true" OnClientItemClicking="onItemClick">
    <Items>
        <telerik:RadMenuItem Text="Slow page" NavigateUrl="Slow.aspx">
        </telerik:RadMenuItem>
        <telerik:RadMenuItem Text="Fast page" NavigateUrl="Fast.aspx">
        </telerik:RadMenuItem>
    </Items>
</telerik:RadMenu>

I hope this helps.

Kind regards,
Tsvetomir Tsonev
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
Tags
Menu
Asked by
Dheeraj
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Share this question
or