Adding target to a button
-
hi, my page contains a button which redirect you when you click on but if i click on that the new page should open in a new window i mean how can we set target in asp.net button..
-
hi, my page contains a button which redirect you when you click on but if i click on that the new page should open in a new window i mean how can we set target in asp.net button..
hello, i used a System.Web.UI.WebControls.HyperLink (the hyperlink) server control instead of button. It has a target property that u can set to _blank. how ever i am not sure how to make the hyperlink look like a button.. perhaps by setting its ImageURL property? HTH :)
full many flowers blush unseen!
-
hi, my page contains a button which redirect you when you click on but if i click on that the new page should open in a new window i mean how can we set target in asp.net button..
As a redirect is done in server code, it's impossible to select a target for it. The target is decided before the request is sent to the server. If you want a different target, you have to set that in the browser before the request is sent to the server. You can use Javascript in an html button:
<input type="button" onclick="window.open('TheNewPage.aspx', '_blank');" />
--- single minded; short sighted; long gone;