How do I use Target=_blank on a response.redirect?

后端 未结 12 1926
梦谈多话
梦谈多话 2020-12-10 16:12

I do not necessarily have to use response.redirect, but that is what I had. I would like to open the selected link in a new window. How do I do that?

context         


        
12条回答
  •  北海茫月
    2020-12-10 16:41

    How about a hyperlink that you program dymanically? Imagine this. asp hyperlink that when you click opens a new window, possibly with no scroll bars, no address bar, anything you want. Here is an example:

    hyperlink1.Attributes.Add("onclick", "window.open(http://www.mylink.com?sessionvar1=" + someValue + "',null,'height=251px, width=600px,status=no, resizable=no, scrollbars=no, toolbar=no,location=no,menubar=no ');");
    

    This is just an alternative to a standard button that would otherwise call a click handler. Keep in mind, you can add the whole thing from the front as an attribute.

提交回复
热议问题