Target = _blank not working

4 posts, 0 answers
  1. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 16 Mar 2012 Link to this post

    Why does the following not open the webpage in a new window, as expected?

    <telerik:RadButton ID="RadButton15" runat="server" 
        PostBackUrl="~/CostDashboard.aspx" Skin="Default" Target="_blank" 
        Text="Costing" Visible="True" Width="200px" ButtonType="LinkButton">
    </telerik:RadButton>

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

    Posted 19 Mar 2012 Link to this post

    Hello David,

    I could run your code and was able to get the webpage loaded in a new window. I did try it on FF, Chrome & IE versions, and this was working as expected. Can you get me the exact scenario, so that I could find out more? Which browser are you using?

    Regards,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. David Penny
    David Penny avatar
    174 posts
    Member since:
    Jun 2006

    Posted 19 Mar 2012 Link to this post

    Hi Shinu,

    I'm running it from Visual Studio, and the browser is IE8. Strange, because I expected it to work as well.

    I'll go back and take another look. Might be something else is off somewhere.

    Dave
  5. Slav
    Admin
    Slav avatar
    1356 posts

    Posted 20 Mar 2012 Link to this post

    Hi David,

    Note that setting the PostBackUrl property of RadButton will result in a post to the specified page. If you want to use the button control as a link in order to open a page in a new window/tab, you should set the NavigateUrl property with the path to the page that should be displayed, as shown below:
    <telerik:RadButton ID="RadButton15" runat="server" NavigateUrl="~/CostDashboard.aspx"
        Skin="Default" Target="_blank" Text="Costing" Visible="True" Width="200px" ButtonType="LinkButton">
    </telerik:RadButton>

    I hope this helps. Please let us know if you run into more difficulties.

    Kind regards,
    Slav
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top