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

RadMenu1_ItemClick

8 Answers 105 Views
Menu
This is a migrated thread and some comments may be shown as answers.
L
Top achievements
Rank 1
L asked on 22 Apr 2008, 11:40 AM

hi

I have this piece of code in the userControl:

Protected Sub RadMenu1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemClick

Select Case e.Item.Text

Case "Invoice"
Label1.Text = "Invoice Administration"
End Select

End Sub

a Label control is also in the same userControl.

This userControl is used by a master page and in turn a default.aspx use this master page.

Now, the thing is that it works fine if i did not add a navigateUrl to the radmenu control (as expected it show on the label "Invoice Administration" when clicked on the Default.aspx page)

But when I add a url to the navigateUrl Property of the Radmenu. Is empty. How should i go about solving this? Thanks

8 Answers, 1 is accepted

Sort by
0
Erjan Gavalji
Telerik team
answered on 22 Apr 2008, 12:10 PM
Hi Lui Nai Wah,

This happens because no postback is raised for items, which have a value set to the NavigateUrl property. The NavigateUrl property is used to specify that an item will navigate the specified URL instead of performing a postback.

I hope this helps.

Kind regards,
Erjan Gavalji
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
L
Top achievements
Rank 1
answered on 23 Apr 2008, 04:33 AM
hi

Thanks, but how do i go about solving this?  There isn't any postback property for me to use. Sorry, if i am giving much trouble. Thanks
0
L
Top achievements
Rank 1
answered on 23 Apr 2008, 04:41 AM
sorry, i found the postback property. Thanks
0
L
Top achievements
Rank 1
answered on 23 Apr 2008, 06:53 AM
hi

I still can't get it to work. I set the postback property to both true and false, but see no result. How do i go about solving this? Thanks
0
Atanas Korchev
Telerik team
answered on 23 Apr 2008, 07:33 AM
Hello Lui Nai Wah,

NavigateUrl takes precedence over the postback. As a workaround you can use the Value property of the menu item to store the url (leave NavigateUrl blank). Then inside the ItemClick event handler you can use Response.Redirect(e.Item.Value) to redirect to the specific page.

regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
L
Top achievements
Rank 1
answered on 23 Apr 2008, 07:54 AM
hi

It still didn't work. Maybe i should post the code here:

Protected

Sub mainMenu_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles mainMenu.ItemClick
Select Case e.Item.Text
Case "Invoice"
Label1.Text = "Invoice Administration"
Response.Redirect(e.Item.Value)
End Select
End Sub

This code is in a userControl and this userControl is used by a master page and in turn a default.aspx uses the master page. What i want is that the label to show the text "Invoice Administration" at the default.aspx header. Now this labal is place at the userControl. Whlie the redirection works fine but label.text is empty. How should i go about it? Thanks

0
Atanas Korchev
Telerik team
answered on 23 Apr 2008, 07:58 AM
Hi Lui Nai Wah,

Setting the Label's test works however the redirect will load a new page where the Label's text is reset to its initial value (because the page is different). You should find a way to transmit the label's text between the two pages (storing it in the Session or passing it via the query string). This

Regards,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
L
Top achievements
Rank 1
answered on 23 Apr 2008, 08:45 AM
Hi Albert

Thanks for the hint. It works fine now.
Tags
Menu
Asked by
L
Top achievements
Rank 1
Answers by
Erjan Gavalji
Telerik team
L
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or