RadMenu1_ItemClick

9 posts, 0 answers
  1. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 22 Apr 2008 Link to this post

    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

  2. Erjan Gavalji
    Admin
    Erjan Gavalji avatar
    1455 posts

    Posted 22 Apr 2008 Link to this post

    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
  3. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 22 Apr 2008 Link to this post

    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
  4. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 22 Apr 2008 Link to this post

    sorry, i found the postback property. Thanks
  5. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 23 Apr 2008 Link to this post

    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
  6. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 23 Apr 2008 Link to this post

    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
  7. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 23 Apr 2008 Link to this post

    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

  8. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 23 Apr 2008 Link to this post

    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
  9. L
    L avatar
    298 posts
    Member since:
    Apr 2008

    Posted 23 Apr 2008 Link to this post

    Hi Albert

    Thanks for the hint. It works fine now.
Back to Top