In VB.NET code in an ASP.NET project, I can call:
And this directs me to "NewPage.aspx" in my current browser window. But how can I open this URL in a new window rather than the current one?VB Code:
Response.Redirect("NewPage.apsx")
Printable View
In VB.NET code in an ASP.NET project, I can call:
And this directs me to "NewPage.aspx" in my current browser window. But how can I open this URL in a new window rather than the current one?VB Code:
Response.Redirect("NewPage.apsx")
You can only open a new window client-side, so send a javascript inline command via the buffer.
That's ridiculous!?!
My form is serverside, therefore all my controls are serverside. You mean I can't possibly open in a new window then?
Sorry that's the way it is, but sending inline javascript only takes a couple of lines of code.
Can I do that from a webcontrol button that is run at the server?Quote:
Originally Posted by GlenW
Yes just send the javascript via Response.Flush after putting the script in the Buffer.
Make sure you pad the buffer first 'cos it won't flush if its contents are too small and your script will be too small.
Do you know if it works with vbscript?
Using the buffer is completely new to me...any code example would be greatly appreciated... :thumb:
This is for javascript in C# shouldn't be too hard to port.Code:Response.Write("<script language=javascript>window.open('PageToOpen.aspx',null, 'height=550, width=800, status=no, toolbar=no, menubar=no, location=no');</script>");
Response.Flush();
Also my syntax may be awry as haven't been able to test it.
I see. Thankyou very much! :wave: