HOW TO:单击ascx页面中的按钮后,在aspx页面中更新面板(ASP.NET / C#) [英] HOW TO: Update panel in aspx page after a button in ascx page is clicked (ASP.NET/C#)
本文介绍了HOW TO:单击ascx页面中的按钮后,在aspx页面中更新面板(ASP.NET / C#)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的aspx文件中有一个更新面板。此面板包含文本框A和按钮A.
单击按钮A,显示ascx模式弹出窗口。 Ascx模式弹出窗口还包含文本框B和按钮B.
单击按钮B后,textBox B中输入的内容将在文本框A中设置。
我将如何做到这一点?
需要帮助。谢谢:)
解决方案
使用javascript会更容易
< span class =code-keyword>< 按钮 id = buttonb önclientclick = return getbuttonbclick() / >
function <> span getbuttonbclick()
{
document .getelementbyid(textboxa).value = document .getelementbyid(textboxb).value
}
onrowdatabound of gridview
buttonb.attributes。 add ( onclick, document.getelementbyid(buttona的clientid).value = document.getelementbyid(按钮b的clientid).value )
在更新面板中它可以正常工作:)
在ascx中,设置textboxA的值然后调用aspx中的面板更新文件。
Hi,
I have an update panel inside my aspx file. This panel contains textbox A and button A.
On click button A, show ascx modal popup. Ascx modal popup also contains textbox B and Button B.
Once Button B is clicked, whatever is inputted in textBox B will be set in Textbox A.
How will i do this?
need help. thanks :)
解决方案
use javascript will be easier
<button id="buttonb" önclientclick="return getbuttonbclick()" />
function getbuttonbclick() { document.getelementbyid(textboxa).value=document.getelementbyid(textboxb).value }
onrowdatabound of gridview
buttonb.attributes.add("onclick","document.getelementbyid(clientid of buttona).value=document.getelementbyid(clientid of button b).value")
inside update panel it will work fine :)
in ascx, set value of textboxA then call updating of panel in aspx file.
这篇关于HOW TO:单击ascx页面中的按钮后,在aspx页面中更新面板(ASP.NET / C#)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文