Menu- Open in new window/tab

2 posts, 0 answers
  1. Neelima
    Neelima avatar
    24 posts
    Member since:
    Aug 2010

    Posted 16 Mar 2011 Link to this post

    I'm using the same page for Adding and editing clients. When I right click on any menu item(Edit Client or Add Client) and  open in a new window/tab, it always opens the page that is in current window/tab.
     In the Radmenu Click event handler, I have the below code.

       Public Shared rqstType As String
      
    Protected Sub RadMenu1_ItemClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadMenuEventArgs) Handles RadMenu1.ItemClick
      
            If RadMenu1.SelectedValue = "Add New Clients" Then
                            rqstType = "Add"
                Response.Redirect("frm_Client.aspx")
      
            ElseIf RadMenu1.SelectedValue = "Edit Existing Clients" Then
                    rqstType = "Edit"
                Response.Redirect("frm_Client.aspx")
            End If
        End Sub


    Thank you
    Neelima


  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 17 Mar 2011 Link to this post

    Hello Nelima,

    As far as I know it is "not possible" to redirect into a new window, because a redirect on the server causes a special HTTP response to be sent to the users browser, the client. The browsers native implementation interprets the special response code and sends the user off to the destination. There's no built-in mechanism or standard for specifying a new window.

    One approach is to use the  RadWindow for opening the desired page. You can follow the following approach to open the window from code-behind.
    Calling radalert from codebehind

    Another approach is to handle the same in the client event OnClientItemClicked. Attach OnClientItemClicked to RadMenu and use client code for opening window in the event handler.
    The Telerik online documentation shows how to open window from client side.


    Thanks,
    Shinu.
Back to Top