Quantcast
Channel: Telerik Forums RSS
Viewing all articles
Browse latest Browse all 94857

LinkButton Mode Opens Two Windows when target is _blank

$
0
0
Hi Charles,

I have already replied to the forum post that was opened by you on the matter, so that I paste my answer below for the rest of the community:

I confirm this is an issue with the control. I have logged it here (
http://feedback.telerik.com/Project/108/Feedback/Details/163485), so that you can comment and monitor its progress

For the time being you can use the following JavaScript workaround:
Copy Code
<telerik:RadButton ID="radbtnVehicleList" runat="server" Text="Google" Skin="Default" Width="200px"
    NavigateUrl="http://www.telerik.com" ButtonType="LinkButton" AutoPostBack="false" Target="_blank">
</telerik:RadButton>
<script>
    Telerik.Web.UI.Button.NavigationFunctionality.prototype = {
        clicked: function (ev) {
            var that = this;
 
            that.base.clicked(ev);
 
            that._handleNavigateUrl();
        },
 
        _handleNavigateUrl: function () {
            var that = this,
                target = that.options.navigateTarget,
                url = that.options.navigateUrl;
 
            if (!url) return;
 
            if (target && target == "_blank")
                window.open(url);
            else if (target && target == "_parent")
                window.parent.location.href = url;
            else if (target && target == "_top")
                window.top.location.href = url;
            else if (!target || target == "_self")
                window.location.href = url;
            else {
                var targetFrame = $("iframe[name='" + target + "']").get(0) ||
                                    $("frame[name='" + target + "']").get(0) ||
                                    $("#" + target).get(0);
 
                if (targetFrame && targetFrame.tagName.toLowerCase().indexOf("frame") > -1) {
                    targetFrame.setAttribute("src", url);
                } else if (target) {
                    window.open(url, target);
                }
            }
        }
 
    };
</script>



Regards,
Danail Vasilev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items

Viewing all articles
Browse latest Browse all 94857

Trending Articles