I have a web app with a start page composed of various links. I used the LinkButton control of System.Web.UI.WebControls for these links. I do a little bit of processing on postback, then I redirect to the appropriate page. The problem I find is that in IE7 I cannot right click the "link" and open in a new tab. The postback occurs and the new page appears, but in the current tab, not a new one! I tried the web app in chrome as well, and chrome doesn't even give the option when right clicking the link.
It appears that if the destination page might need to be opened in a new tab by the user, I need to use a hyperlink or the hyperlink control. However, it would be nice if I still had the option to do some processing before jumping to that link.
Typically it is bad practice to use a LinkButton like a normal hyper link, and even a worse idea to do a 302 redirect after the POST back has occurred.
Also you still can do some pre-processing on an actual hyperlink, but you just do it in a different manor. If you tell us what you are doing maybe we can help find a better way.
You could use a HyperLink to some intermediate page and pass some querystring parameters. And then do your redirect in the pageload of the intermediate page. That way you could still open up the links in a new tab or window.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With