在asp.net中弹出窗口不显示 [英] pop up windows not shows in asp.net
本文介绍了在asp.net中弹出窗口不显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello Everyone,
我使用以下代码显示弹出消息,但我没有得到任何东西请检查这个
Hello Everyone,
I used the following code to display popup message but i am not getting any thing Please check this
string msg = "Unselected Sample ID's can't be deleted because they are used in other sections.";
ScriptManager.RegisterStartupScript(this, this.GetType(), "aa", "alert('" + msg + "');", true);
谢谢
Thanks
推荐答案
嗨ErBhati,
试试这个..
string msg =未选中样本ID \\不能删除,因为它们在其他部分中使用。;
ScriptManager.RegisterStartupScript(this,this .GetType(),aa,alert('+ msg +');,true);
如果有任何疑问请参考以下链接:
http://stackoverflow.com/questions/5855670/why-using-javascript-escape-character-of-quotation-in-string-need-to-be-inst [ ^ ]
Hi ErBhati,
Try this..
string msg = "Unselected Sample ID\\'s can\\'t be deleted because they are used in other sections.";
ScriptManager.RegisterStartupScript(this, this.GetType(), "aa", "alert('" + msg + "');", true);
If any doubts regarding this, refer the link below:
http://stackoverflow.com/questions/5855670/why-using-javascript-escape-character-of-quotation-in-string-need-to-be-inst[^]
Hi
If you are using update panel in your page and want to display a message box then use the below
ScriptManager.RegisterStartupScript(this.UP, typeof(string), "Alert", "alert('Message here');", true);
If you don't have Update Panel then use the below
Response.Write("<script language=javascript>alert('Message here.')</script>");
Hope this helps.
尝试使用Page.RegisterStartupScript或ClientScript.RegisterStartupScript方法。
你会认为这是一个笑话,但删除; haha
You will think it is a joke, but remove the ; and it will work haha
ScriptManager.RegisterStartupScript(Page, GetType(), "ShowPopup", "alert('Você não tem permissão para acessar essa página')", true);
也请注意你应该在表格中进行,至少我是如何复制它。
also, notice that you should do it inside a Form, at least that was how I reproduced it.
这篇关于在asp.net中弹出窗口不显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文