Creating new window in Webpage

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to create a new window in a Web browser using the Response.
Redirect command? Many times I want to create a new window but am unable
with the Response.Redirect command. I can do it with a Javascript but I want
to be able to pass some dynamic parameters which I cannot do in Javascript.
Any help will be appreciated.
 
Response.redirect does nothing more than tell the browser to load a new URL
address, so you cannot open a new window with it.

Regards

John Timney (MVP)
 
John;
Thanks for your reply. I assume then that Javascript is the only way to
open a new window using C# in ASP.NET.
 
Dave;
Thank you so much for your help. I made the changes you suggested and it
worked! I needed to make the url command dynamic so I created the code as
shown below which allows me to pass a different url to the button command
each time it is clicked.

string url = "http://www.minonktalk.com"; // This can be a dynamic
variable
string command = "window.open('" + url + "')";
this.Button1.Attributes.Add("onclick", command);
 
Back
Top