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
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
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
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
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
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
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
Thanks for the hint. It works fine now.