JavaScript embedded in C#

cathiec

Freshman
Joined
Mar 8, 2004
Messages
28
I have the following piece of code that is supposed to open a file in a new browser window.

sb.Append("<SCRIPT>");
sb.Append("window.open('DemoFiles/" + strFilename + "');");
sb.Append("</SCRIPT>");

Response.Write(sb.ToString());


sb is a StringBuilder object
Reports is the name of the folder where i want to the files to be created
strFileName is the name of the file that i want to open

The user clicks a button and the file is created in the folder and opens when i build and browse from the visual studio.NET application. When i try to navigate to the form from a browser the forms appears but when i click the button the file is created in the folder but does not automatically open like it does in visual studio.

i would greatly appreciate any suggestions
Regards,
cathiec
 
Back
Top