本文介绍了当对话框打开时,后台页面消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在下面的代码中,当对话框打开时,后台页面消失。

亲切的帮助



for(int i = 1; i< = list.Count; i ++)

{

if(list [i] == list [i - 1])

{

ClientScript.RegisterClientScriptBlock(GetType(),Javascript,

< script> alert('Record added)成功')< / script>);

//Page.ClientScript.RegisterStartupScript(this.GetType(),myalert,alert('输入唯一值');,true );

}

}

Hi,
In the below code when the dialog box opens, the background page disappears.
kindly help

for (int i = 1; i <= list.Count; i++)
{
if (list[i] == list[i - 1])
{
ClientScript.RegisterClientScriptBlock(GetType(), "Javascript",
"<script>alert('Record Added Successfully')</script>");
//Page.ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('Enter unique values');", true);
}
}

推荐答案

<script type="text/javascript">
    var recordAddedSuccess = false;
</script>

This can be anywhere on the page as long as it is UNDER recordAddedSuccess definition.
<script type="text/javascript">
function showMessage() {
    if (recordsAddedSuccess)
        alert('Record Added Successfully');
// reset the variable
    recordsAddedSuccess = false;
}

// this assumes jQuery...if you don't use it, use window.onload event








在您的注册表中脚本服务器端,设置recordAddedSuccess = true;当页面加载时,该方法将执行并显示您的消息。





如果这有帮助请花时间接受解决方案。谢谢。




In your register script server side, set recordAddedSuccess = true; When the page loads, the method will execute and your message will be shown.


If this helps please take time to accept the solution. Thank you.


这篇关于当对话框打开时,后台页面消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-26 15:09