Is it wrong to use LinkButtons as hyperlinks?

I have a web application with a start page consisting of different links. I used the LinkButton control for System.Web.UI.WebControls for these links. I process the postback a bit, then redirect to the appropriate page. The problem that I find is that in IE7 I cannot right-click on the link and open it in a new tab. Sending occurs, and a new page appears, but on the current tab is not new! I also tried the web application in chrome, and chrome does not even give this parameter when clicking a link directly.

It seems that if the destination page can be opened in a new tab by the user, I need to use a hyperlink or a hyperlink. However, it would be nice if I still had the opportunity to do some processing before going to this link.

+3
source share
3 answers

Usually, using LinkButton as a regular hyperlink is bad practice, and even the worst idea is to redirect 302 after a POST error has occurred.

  • First, it breaks the browser interaction that you already found.
  • But more importantly, it breaks the search engine indexing of your site, if you have an external site.

, - , . , , , .

+6

HyperLink . pageload . , .

+1

, ? , ( 2 ), .

+1

Source: https://habr.com/ru/post/1702379/


All Articles