asp.net – 链接按钮属性在新选项卡中打开?

在我的应用程序中,我有一些链接按钮,但是当我右键单击它们时,我无法(它们处于禁用模式),查找菜单项在新选项卡中打开或在新窗口中打开.

如何显示这些菜单项?

代码示例:

<asp:LinkButton id="lbnkVidTtile1" runat="Server" CssClass="bodytext" Text='<%#Eval("newvideotitle") %>'  />

解决方法

docs

Use the LinkButton control to create a hyperlink-style button on the Web page. The LinkButton control has the same appearance as a HyperLink control,but has the same functionality as a Button control. If you want to link to another Web page when the control is clicked,consider using the HyperLink control.

由于这并不是在标准意义上实际上执行链接,控件上没有Target属性(HyperLink控件确实有一个Target) – 它试图通过文本链接对服务器执行PostBack.

根据你想要做的,你可以:

>使用HyperLink控件,并设置Target属性
>为OnClientClick property提供一个方法,打开一个新窗口到正确的地方.>在处理PostBack的代码中,添加一些JavaScript将在PageLoad上启动,这将打开一个新窗口正确的位置.

相关文章

### 创建一个gRPC服务项目(grpc服务端)和一个 webapi项目(...
一、SiganlR 使用的协议类型 1.websocket即时通讯协议 2.Ser...
.Net 6 WebApi 项目 在Linux系统上 打包成Docker镜像,发布为...
一、 PD简介PowerDesigner 是一个集所有现代建模技术于一身的...
一、存储过程 存储过程就像数据库中运行的方法(函数) 优点:...
一、Ueditor的下载 1、百度编辑器下载地址:http://ueditor....