Sunday, August 2, 2009

Open a new popup window on server side using c#?

I have server side button, when I click this button, it will go to server side function, in this function, I want to open a new popup window with parameter, I use following code to do that, but the window doesn't popup, what's wrong with my code?





Response.Write("%26lt;SCRIPT LANGUAGE=JavaScript%26gt;\n");


Response.Write("window.open('/PopUp/Po...


Response.Write("%26lt;/SCRIPT%26gt;");





Thanks,

Open a new popup window on server side using c#?
Basically, you missed the escape lashes before some special characters


so the code should be,


Response.Write("%26lt;SCRIPT LANGUAGE=\"JavaScript\"%26gt;\n");


Response.Write("window.open( \"\/PopUp\/Popup.html\", \"\", \"width=300, height=100\")");


Response.Write("%26lt;\/script%26gt;");


No comments:

Post a Comment