Radbutton CommandArgument Open New Tab

2 posts, 0 answers
  1. Mohammed
    Mohammed avatar
    4 posts
    Member since:
    Jun 2014

    Posted 25 May Link to this post

    Hi,

    I have a radbutton which when pressed updates some profile variables and then redirects to another page. What I am trying to achieve is to have a new tab open when the button is pressed instead of the same tab redirecting to another page.

    The radbutton is located within a GridTemplateColumns in a Ragrid if that makes a difference:

    <telerik:RadButton ID="SelectC" runat="server" Text="Select" CommandName="Select"                                  CommandArgument='<%#Eval("Rulcode_Child")+","+ Eval("UIO_ID")+","+ Eval("PERSON_CODE")%>' >
    </telerik:RadButton>

    protected void gridEnrolmentsCourse_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "Select")
        {
            string[] commandArgs = e.CommandArgument.ToString().Split(new char[] { ',' });
            Profile.Rulcode = Convert.ToInt32(commandArgs[0]);
            Profile.UIOID = Convert.ToInt32(commandArgs[1]);
            Profile.Percode = Convert.ToInt32(commandArgs[2]);
     
            if (ViewState["PreviousPage"] != null)
            {
                //Open new tab here somehow
                Response.Redirect(ViewState["PreviousPage"].ToString());
            }
        }
    }

  2. Mohammed
    Mohammed avatar
    4 posts
    Member since:
    Jun 2014

    Posted 26 May Link to this post

    Solved.

         string url = ViewState["PreviousPage"].ToString();
         string script = string.Format("window.open('{0}');", url);
         ScriptManager.RegisterStartupScript(Page, Page.GetType(), "newPage" + UniqueID, script, true); 

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top