How to catch url selected before send to url

2 posts, 0 answers
  1. Luis
    Luis avatar
    2 posts
    Member since:
    Dec 2013

    Posted 18 Aug 2014 Link to this post

    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?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 19 Aug 2014 in reply to Luis Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top