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

How do I set NavigateURL via server code?

4 Answers 121 Views
ToolBar
This is a migrated thread and some comments may be shown as answers.
Tomica
Top achievements
Rank 2
Tomica asked on 05 May 2008, 11:03 PM
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)

4 Answers, 1 is accepted

Sort by
0
Accepted
Erjan Gavalji
Telerik team
answered on 06 May 2008, 08:37 AM
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
0
Tomica
Top achievements
Rank 2
answered on 06 May 2008, 02:58 PM
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!
0
Raddy Rad
Top achievements
Rank 1
answered on 10 Oct 2009, 03:29 PM
how about through javascript?
0
Veselin Vasilev
Telerik team
answered on 12 Oct 2009, 09:25 AM
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.
Tags
ToolBar
Asked by
Tomica
Top achievements
Rank 2
Answers by
Erjan Gavalji
Telerik team
Tomica
Top achievements
Rank 2
Raddy Rad
Top achievements
Rank 1
Veselin Vasilev
Telerik team
Share this question
or