FinTagByUrl alwasy returns null

2 posts, 0 answers
  1. Gangleri
    Gangleri avatar
    18 posts
    Member since:
    Nov 2006

    Posted 01 Dec 2006 Link to this post

    Hi,

    I have a RadTabStrip defined as follows on a page:

    <radts:radtabstrip id="RadTabStrip1" runat="server">
      <Tabs>
          <radTS:Tab runat="server" Text="Page 1" NavigateUrl="Page1.aspx"></radTS:Tab>
          <radTS:Tab runat="server" Text="Page 2"       NavigateUrl="Page2.aspx"></radTS:Tab>
      </Tabs>
    </radts:radtabstrip>

    However when I try to use the FindTabByUrl like so I always get null.

    RadTabStrip1.FindTabByUrl("Page2.aspx")

    Thanks for any help
    Gangleri.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 01 Dec 2006 Link to this post

    Hi Gangleri,

    That's by design. FindTabByUrl calls ResolveUrl to make the url application relative so Page1.aspx becomes something like /YourApp/Page1.aspx. In your case you can use "~" to denote the web application name:

    <radTS:Tab runat="server" Text="Page 1" NavigateUrl="~/Page1.aspx"></radTS:Tab>

    RadTabStrip1.FindTabByUrl("~/Page2.aspx")

    If this is not feasible you can enumerate the tabs and check their NavigateUrl property:
    foreach (Tab tab in RadTabStrip1.GetAllTabs())
    {
        if (tab.NavigateUrl == "Page2.aspx")
        {
            ....
        }
    }
    Greetings,
    Albert
    the telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top