link button property to open in new tab?

前端 未结 8 1338
野趣味
野趣味 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:02

    From the 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.

    As this isn't actually performing a link in the standard sense, there's no Target property on the control (the HyperLink control does have a Target) - it's attempting to perform a PostBack to the server from a text link.

    Depending on what you are trying to do you could either:

    1. Use a HyperLink control, and set the Target property
    2. Provide a method to the OnClientClick property that opens a new window to the correct place.
    3. In your code that handles the PostBack add some JavaScript to fire on PageLoad that will open a new window correct place.

提交回复
热议问题