如何在c#中使用链接按钮而不是超链接打开新标签 [英] how can open a new tab using link button not hyper link in c#

查看:130
本文介绍了如何在c#中使用链接按钮而不是超链接打开新标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要帮助plz帮助尽快找到

i need help plz help as soon as posible

推荐答案

为什么你需要C#代码,当它可以使用客户端语言轻松处理JavaScript?总是尝试使用简单的方法而不是实现某些目标的艰难方法,C#代码将不如为您的网站打开具有指定URL的新选项卡的JavaScript代码一样高效。



在您的JavaScript语言中尝试以下代码(在HTML标记的脚本元素中编写)



Why do you need C# code for that, when it can be easily handled using the client-side language of JavaScript? Always try using the easy approach not the hard way of achieving something, C# code won't be as efficient as a JavaScript code that would open a new tab for your website with specified URL in it.

Try the following code in your JavaScript language (write this inside script element of your HTML markup)

window.open("<url>", "<windowname>");





有关详细信息,请阅读此MDN文档 [ ^ ]。


这篇关于如何在c#中使用链接按钮而不是超链接打开新标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆