我想编写代码以在新选项卡中打开超链接在新选项卡中打开的属性是什么。如果我添加target = _blank给出错误
firstCell.Controls.Add(new HyperLink { NavigateUrl = "~/TargetReportsDetails.aspx?cat=" + categoryname + "&LinkSubmtdDate=" + lnksubsndt + " &LinkSubmittedBy=" + LinkSubmittdBy + " ", Text = firstCell.Text});
答案 0 :(得分:-1)
要从超链接打开新标签页,我们可以在C#中使用Target="_blank"
。
firstCell.Controls.Add(new HyperLink { NavigateUrl = "~/TargetReportsDetails.aspx?cat=" + categoryname + "&LinkSubmtdDate=" + lnksubsndt + " &LinkSubmittedBy=" + LinkSubmittdBy + " ", Text = firstCell.Text,Target="_blank"});