如果我们使用UpdatePanel控件,如何显示弹出窗口 [英] how to show popup window if we use UpdatePanel control

查看:51
本文介绍了如果我们使用UpdatePanel控件,如何显示弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

Web应用程序,
我有两个文本框(text1和text2)和一个按钮(btn_save)控件.我已将此控件置于UpdatedPanel控件下.我的问题是,一旦单击btn_save按钮弹出窗口,我就会使用以下代码显示确认信息:

Hi All,

web application,
I''ve two Textboxes(text1 and text2) and one button (btn_save)contols.And i''ve put this conrols under UpdatedPanel control.My question is as soon as click on btn_save button popup should come up and i''ve used following code to show confirmation:

ClientScript.RegisterStartupScript(this.GetType(), "Mess", "<script> alert( '' Entered Data Saved Successfully'')</script>", false);



但是如果我使用updatedpanel控件,弹出窗口是不会出现的,否则它会正常工作.请给出一个示例.



But popup is not comming up if i use updatedpanel control, or else its working fine.please reply with an example.

推荐答案

而不是ClientScript.RegisterStartupScript使用ScriptManager.RegisterStartupScript


尝试使用javascript


按钮事件

写``onclientclick =''fun1()''




函数fun1()
{
alert(``成功保存'')
}
try to use javascript


on button events

write ''onclientclick=''fun1()''




function fun1()
{
alert(''saved successfully'')
}


编写此代码即可使用

blMsg.Text =课程名称已存在..."

ScriptManager.RegisterStartupScript(Me.Page,Me.GetType,"ClientScript","alert("& lblMsg.Text&"'');,True)
Write this Code it will work

blMsg.Text = "Course Name already Exists..."

ScriptManager.RegisterStartupScript(Me.Page, Me.GetType, "ClientScript", "alert(''" & lblMsg.Text & "'');", True)


这篇关于如果我们使用UpdatePanel控件,如何显示弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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