How do I set NavigateURL via server code?

5 posts, 1 answers
  1. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 05 May 2008 Link to this post

    How do I reference the NavigateURL property on a toolbar button.

    I can change manipulate several properties such as:

    me.toolbar1.items(1).text = "click me"
    me.toolbar1.items(1).enabled = true

    I cannot see how to get a handle on the URL value, which I need to update with query string values that are read at runtime from a database.

    (p.s. assume I have less than one day experience with the toolbar control)
  2. Answer
    Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 06 May 2008 Link to this post

    Hi Tom,

    RadToolBar for ASP.NET Ajax contains several types of items, all inheriting RadToolBarItem. As the Text property is common for all items, it can be accessed directly. The NavigateUrl property is available only for the button items (RadToolBarButton and RadToolBarSplitButton). To access it you need to cast the item to the specific class, using the CType statement.

    Please, find attached a small page, containing some example code. I hope it helps.

    Kind regards,
    Erjan Gavalji
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Tomica
    Tomica avatar
    147 posts
    Member since:
    Apr 2008

    Posted 06 May 2008 Link to this post

    That is it, and thanks for a prompt & precise answer that actually works the first time.

    I can see why Telerik is winning all those awards!
  5. Raddy Rad
    Raddy Rad avatar
    24 posts
    Member since:
    Oct 2009

    Posted 10 Oct 2009 Link to this post

    how about through javascript?
  6. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 12 Oct 2009 Link to this post

    Hi Raddy Rad,

    You can use the set_navigateUrl(url) method of the RadToolBarItem object. We will add it to the documentation.



    Greetings,
    Veselin Vasilev
    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017