从更新面板中的代码打开javascript警报 [英] Open javascript alert from code behind in update panel

查看:64
本文介绍了从更新面板中的代码打开javascript警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




在我的页面中我有arround 14更新面板,在我的updatepanel6中我有一个按钮,在那个按钮上单击我想用javascript打开新表单,当我调试代码..工作正常,但它没有打开弹出窗口



i已经尝试了所有方法

//

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
//

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.GetTy pe(),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 。开( ../操作/ PVPRINTING.aspx; < / script>);





谢谢



Ankita Mali


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

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

推荐答案

试试这个



try this

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






on your button

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);


点击此链接可以找到您在此处找到的正确信息。 />


http://stackoverflow.com/questions/20044762/javascript-alert-is-not-working-in-update-panel-in-asp-net [ ^ ]





另一个链接如下。



http://forums.asp.net/t/1851832.aspx?Javascript+is+not+working+in+the+asp+net+update+panel+after+postback+ [< a href =http://forums.asp.net/t/1851832.aspx?Javascript+is+not+working+in+the+asp+net+update+panel+after+postback+\"target =_ blanktitle =新窗口> ^ ]
hit this link a correct information you can find here.

http://stackoverflow.com/questions/20044762/javascript-alert-is-not-working-in-update-panel-in-asp-net[^]


another link have below.

http://forums.asp.net/t/1851832.aspx?Javascript+is+not+working+in+the+asp+net+update+panel+after+postback+[^]


这篇关于从更新面板中的代码打开javascript警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆