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

How to catch url selected before send to url

1 Answer 52 Views
Menu
This is a migrated thread and some comments may be shown as answers.
Luis
Top achievements
Rank 1
Luis asked on 18 Aug 2014, 05:15 PM
Hello,
I want to catch the clicked menu to know de url user has clicked and validate before send this,

protected void RadMenu1_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
    {
       string myitme = RadMenu1.SelectedItem.ToString();

        if (e.Item.Text == "Autorizar")
        {
  
            Response.Write("You has selected Autorizar, You will be redirected to Autorizar.html");
            Response.Redirect("Autorizar.html");
        }
}

Anyone knows how can I do this?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 19 Aug 2014, 05:01 AM
Hi Luis,

In order to achieve your scenario one suggestion is try to set the NavigateUrl property of RadMenuItem. NavigateUrl and Target cause the menu item to automatically launch another Web page (specified by NavigateUrl) in the window specified by Target. If the Target property is not set, the new Web page uses the current browser window. Please have  a look into the below ASPX.

ASPX:
<telerik:RadMenuItem Text="Google" NavigateUrl="http:\\www.google.com" Target="_blank">
</telerik:RadMenuItem>

In the case of assigning URL from server side please have a look into below code snippet.

C#:
protected void rmenuUrlItems_ItemClick(object sender, Telerik.Web.UI.RadMenuEventArgs e)
{
    if (e.Item.Text == "Telerik")
    {
        Response.Redirect("http://www.telerik.com",false);
    }
}

Thanks,
Shinu.
Tags
Menu
Asked by
Luis
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or