Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Mar 16, 2009 07:59 AM by Lance Zhang - MSFT
Member
70 Points
223 Posts
Mar 11, 2009 06:21 AM|LINK
hi All,
I try to open new ffrom button event like:
but I get error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
can anyone help me ...
thanks
khalid
Participant
1770 Points
406 Posts
Mar 11, 2009 12:50 PM|LINK
HI
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
http://www.javascript-coder.com/window-popup/javascript-window-open-example1.html
http://www.quirksmode.org/js/popup.html
http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html
Thanks
Venky
All-Star
66619 Points
11270 Posts
Mar 12, 2009 03:14 AM|LINK
what is the error you are getting
Set the last parameter as true instead of false in ScriptManager.RegisterStartupScript, I think this will solve your error
http://forums.asp.net/p/1093188/2073837.aspx
33091 Points
2361 Posts
Mar 16, 2009 07:59 AM|LINK
The issue is because of there is an unclosed comma:
khalid2008 ScriptManager.RegisterStartupScript(Page, Page.GetType(), "newWindow", "window.open('../../DataControlManager/Online complain/frmComplaintRevision.aspx?ID=" + _cId + "','_blank','status=1,toolbar=0,menubar=0,location=1,scrollbars=1,resizable=1,width=30,height=30);", false);
<%@ Page Language="C#" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script runat="server"> protected void Button1_Click(object sender, EventArgs e) { string _cId = ""; ScriptManager.RegisterStartupScript(Page, Page.GetType(), "newWindow", "window.open('../../DataControlManager/Online complain/frmComplaintRevision.aspx?ID=" + _cId + "','_blank','status=1,toolbar=0,menubar=0,location=1,scrollbars=1,resizable=1,width=30,height=30');", true); } </script> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript"> function pageLoad() { } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:ScriptManager ID="ScriptManager1" runat="server" /> </div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> </form> </body> </html>
khalid2008
Member
70 Points
223 Posts
window.open using scriptmanager.RegisterStartUpScript
Mar 11, 2009 06:21 AM|LINK
hi All,
I try to open new ffrom button event like:
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "newWindow", "window.open('../../DataControlManager/Online complain/frmComplaintRevision.aspx?ID=" + _cId + "','_blank','status=1,toolbar=0,menubar=0,location=1,scrollbars=1,resizable=1,width=30,height=30);", false);but I get error!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
can anyone help me ...
thanks
khalid
venziar
Participant
1770 Points
406 Posts
Re: window.open using scriptmanager.RegisterStartUpScript
Mar 11, 2009 12:50 PM|LINK
HI
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml
http://www.javascript-coder.com/window-popup/javascript-window-open-example1.html
http://www.quirksmode.org/js/popup.html
http://www.devguru.com/Technologies/ecmascript/quickref/win_open.html
Thanks
Venky
chetan.sarod...
All-Star
66619 Points
11270 Posts
Re: window.open using scriptmanager.RegisterStartUpScript
Mar 12, 2009 03:14 AM|LINK
what is the error you are getting
Set the last parameter as true instead of false in ScriptManager.RegisterStartupScript, I think this will solve your error
http://forums.asp.net/p/1093188/2073837.aspx
Senior Software Engineer,
Approva Systems Pvt Ltd, Pune, India.
Lance Zhang ...
All-Star
33091 Points
2361 Posts
Re: window.open using scriptmanager.RegisterStartUpScript
Mar 16, 2009 07:59 AM|LINK
The issue is because of there is an unclosed comma:
Please try the following demo, which works fine on our lab:
Thanks.