Can you set background color in window.open?

Is it possible to do something like this from code behind?:

Response.Write("<script>mywindow = window.open('" + script + "'); myWindow.document.bgColor='" + color1 + "'</script>")

When I open an excel spreadsheet, it takes awhile and the background is transparent initially. It looks odd. Thank you for any ideas you might have.

pamwestphalAsked:
Who is Participating?
 
Rikin ShahConnect With a Mentor Microsoft Dynamics CRM ConsultantCommented:
Try this way-
 
var anotherwindow=window.open("whatever.htm");
// change the background color of the second window from main
anotherwindow.bgColor="black";

Open in new window

0
 
Rikin ShahMicrosoft Dynamics CRM ConsultantCommented:
Do you mean you're opening an Excel sheet on window.open doc? If yes then have it on the DIV with an initial back color.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.