Click here to Skip to main content
16,020,669 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Hi
In my page i have arround 14 update panel ,in my updatepanel6 i have one button ,on that button click i want to open new form using javascript ,when i debug code ..it is working fine but it is not opening pop up window

i have tried following all methods
//
JavaScript
Page.RegisterStartupScript("PrintPurchaseOrder", "<script language=JavaScript>window.open('../Operation/PVPrinting.aspx','Hello', 'width=500,height=450,menubar=no,status=yes,location=no,toolbar=no,scrollbars=no,modal=yes,resizable=no,background-color: #ccc,border: 1px solid #000,padding: 10px').focus();  </script>");

-----------------------------------------------------------------------------

ScriptManager.RegisterStartupScript(this.UpdatePanel6, this.UpdatePanel6.GetType(), "key", "alert('Test alert');",true);
----------------------------------------------------------------

ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "PrintPurchaseOrder", "<script language=JavaScript>window.open('../Operation/PVPRINTING.aspx', </script>", true);
----------------------------------------

// ClientScript.RegisterClientScriptBlock(this.GetType(), "PrintPurchaseOrder", "<script language=JavaScript>window.open('../Operation/PVPRINTING.aspx; </script>");


Thank you

Ankita Mali
Posted
Updated 23-Aug-16 7:30am
v2

try this

C#
ScriptManager.RegisterStartupScript(this, this.GetType(), "key", "alert('Test alert');", true);
 
Share this answer
 
Comments
Ankita M 8-Feb-14 1:27am    
thanx for u r replay Karthik ...but it is not working...this line get exiicuted ...but pop up is not displaying
King Fisher 8-Feb-14 1:32am    
enable your popup block on your Browser
Karthik_Mahalingam 8-Feb-14 1:33am    
you are calling this function in page load or on button click ??
Karthik_Mahalingam 8-Feb-14 1:33am    
try this

string script = "<script type=\"text/javascript\"> alert('Test alert'); </script>";

Page.ClientScript.RegisterStartupScript(this.GetType(),"key",script);
Ankita M 8-Feb-14 1:33am    
but in all other pages pop up getting displayed
on your button

C#
string url = ";form_name.aspx?ID=" + TextBox1.Text;

               string fullURL = "window.open('" + url + "', '_blank', 'height=500,width=1003,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";

               ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);
 
Share this answer
 
v3
Comments
Ankita M 8-Feb-14 1:31am    
this is also not working for me
 
Share this answer
 
Comments
Ankita M 8-Feb-14 1:42am    
I appreciate All help ,but nothing is working for me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900