MDI Example question

2 posts, 0 answers
  1. Campbell
    Campbell avatar
    3 posts
    Member since:
    Jan 2013

    Posted 19 Feb 2013 Link to this post


    I am new to telerik and slowly working my way through the product so please excuse my ignorance.

    I have looked at the Window MDI example which I think might be  quite a nice way to present my Dashboards and BI Forms. Where I am a little confused is that in the menu item you place the URL in the value property as opposed to the navigate URL property. The challenge I have is that normally, if using a standard menu, I would put something like ~/Sales/DailySales.aspx in the navigate URL property but the same does not work for the Value property.

    In all the examples I have seen the all call external URL's using a fully qualified URL. If I try and use ~/sales/DailySales.aspx it cannot find the page.

    What am I doing wrong?

  2. Marin Bratanov
    Marin Bratanov avatar
    3899 posts

    Posted 19 Feb 2013 Link to this post

    Hello Campbell,

    If you examine the demo's scripts you will see that the value is used to obtain the string that is used as the URL for RadWIndow. Note that this must be a client-side resolvable URL, one you could type in the browser and have it work - either an absolute, or a relative path is needed. The tilde symbol (~) is used to represen the site root on the server and the browser cannot read it. You could replace it with a slash (/) on the client in most cases. Another reason why the Value is used is to prevent the default action of a menu with a NavigateUrl - taking the browser to this page. If you are building your menus in the code-behind you can concatenate the URL with ResolveUrl("~/"); to get the root.

    Said shortly, you would need an URL in the following format:
    <telerik:RadMenuItem Text="First" ImageUrl="images/first.png" Value="myFirstPage.aspx">

    because the browser cannot resolve "~/myFirstPage.aspx" and thus, neither can RadWindow. This works in server controls that direcrly use this because they resolve it internally (see the ResolveUrl() method) which is not the case here.

    Kind regards,
    Marin Bratanov
    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