KavyaVS
asked on
Page.ClientScript.RegisterStartupScript is not working
Hi,
I am trying to open a window and passing the parameters in button click event in .Net 3.5 application,VS 2010.
I added this code in button_click event:
Page.ClientScript.Register StartupScr ipt(this.G etType(), "Pop up", "<script language='javascript'>" + "window.open('/Forms/AddNe wInfo.aspx ?param1=" + txtbx1.Text.Trim() + "¶m2=" + txtbx2.Text.Trim() + "',null,'height=1000, width=1000,status= no,resizable= yes, scrollbars=yes, toolbar=no,location=no,men ubar=no ');</script>");
Any suggestions please.
Thanks
I am trying to open a window and passing the parameters in button click event in .Net 3.5 application,VS 2010.
I added this code in button_click event:
Page.ClientScript.Register
Any suggestions please.
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I tried this after changing the path.But still the page is not opening up in new window.
I am using Ajax toolkit and update panel in the page.
Is anything prevent opening the page?
Page.ClientScript.Register StartupScr ipt(this.G etType(), "Pop up", "<script language='javascript'>" + "window.open('~/Forms/AddN ewInfo.asp x?param1=" + txtbx1.Text.Trim() + "¶m2=" + txtbx2.Text.Trim() + "',null,'height=1000, width=1000,status= no,resizable= yes, scrollbars=yes, toolbar=no,location=no,men ubar=no ');</script>");
Thanks
I am using Ajax toolkit and update panel in the page.
Is anything prevent opening the page?
Page.ClientScript.Register
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hi patil786,
I checked my browser. JavaScript is not disabled.
Please find the attached .aspx code and code behind files.
Please let me know if I need to make any changes.
Thanks
Default2-062913.txt
Default-code.txt
I checked my browser. JavaScript is not disabled.
Please find the attached .aspx code and code behind files.
Please let me know if I need to make any changes.
Thanks
Default2-062913.txt
Default-code.txt
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I checked and closed all the tags and changed the aspx page.
Please see the attached aspx page. It's still not opening the page in new window.
Thanks
Default2-070313.txt
Please see the attached aspx page. It's still not opening the page in new window.
Thanks
Default2-070313.txt
ASKER
Thanks
i've tried your code its working fine here.
may be there would be a path problem within the script just try this way
Page.ClientScript.Register
as your code is working as expected.
hope this helps.