link button property to open in new tab?

前端 未结 8 1344
野趣味
野趣味 2020-11-27 07:15

In my application I have some link buttons there but when I right click on them I cannot (they are in disable mode) find the menu items Open in new tab or

8条回答
  •  隐瞒了意图╮
    2020-11-27 08:05

    Here is your Tag.

    Open Test Page
    

    Here is your code on the code behind.

    LinkButton1.Attributes.Add("href","../Test.aspx")
    LinkButton1.Attributes.Add("target","_blank")
    

    Hope this will be helpful for someone.

    Edit To do the same with a link button inside a template field, use the following code.

    Use GridView_RowDataBound event to find Link button.

    Dim LB as LinkButton = e.Row.FindControl("LinkButton1")         
    LB.Attributes.Add("href","../Test.aspx")  
    LB.Attributes.Add("target","_blank")
    

提交回复
热议问题