DuskDweller
asked on
Calling a javascript, syntax problem.
Hi, I'm trying to open a new window injecting a javascript in my C# codebehind, actually I've managed to open the new window, but there seems to be a problem with the string that C# turns into JS, because the page is blank and gives me the error "Server error in application "/".
Here's the code, it should be simple to sort this out.
Here's the code, it should be simple to sort this out.
This is the C# code to create the JS string:
js = "<SCRIPT LANGUAGE=\"JavaScript\">\n";
js += "window.open(\"/stampe/frame.aspx?pfid=RULLS\", \"\", \"width=300, height=100\")";
js += "</script>";
This is the content of the js variable just before I pass it to Response.Write(js):
"<SCRIPT LANGUAGE=\"JavaScript\">\nwindow.open(\"/stampe/frame.aspx?pfid=RULLS\", \"\", \"width=300, height=100\")</script>"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you!
Try below code:
Open in new window