如何在ASP.NET中从一个用户控件向另一个用户控件发送值 [英] How to send value from one usercontrol to another in asp.net

查看:62
本文介绍了如何在ASP.NET中从一个用户控件向另一个用户控件发送值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我正在使用Ajax Controol工具箱的控件制作一个我引用了用户控件的启用了Ajax的aspx页面.在该用户控件中,我包括另一个用户控件,该控件将在按钮的单击事件中显示为弹出窗口.将用户控件显示为弹出窗口,我使用ModalPopupExtender控件.从显示为弹出窗口的控件中,我想将值发送到父usecontrol,然后关闭弹出用户控件.我也使用代表.当我调试时,它表明该值正在分配给父usercontrol的文本框,但它没有出现在文本框中.如果它无法理解,请告诉我,我还将向您显示代码.请帮帮我.

Hi All,
I am using Ajax Controol toolkit''s control to make an ajax enabled aspx page on which i am referencing a user control. In that user control i include another usercontrol which will appear as popup on click event of button. to show the usercontrol as a popup i uses ModalPopupExtender control. From the control which appear as a popup i want to send the value to the parent usecontrol and then close the popup usercontrol. i also use the delegates. when i debug then it shows that value is assigning to the textbox of parent usercontrol but it does not appear in the textbox. if its not understandable then tell me i will also show you the code. please help me out.

推荐答案

您的父用户控件需要部分刷新.触发子窗口的updatpanel是否也控制父页面"文本框? (这样,如果触发了更新面板,那么文本框的值也会被刷新吗?)

此外,如果该场景类似于本文,则可能会有所帮助:
在子窗口关闭时通过AJAX(ASP.NET 2.0)对父页面进行部分更新-有条件地 [ ^ ]
You parent usercontrol needs a partial refresh. Is the updatpanel that triggers the child window, controls the Parent page textbox too? (such that if update panel is triggered then the textbox value will also get refreshed?)

Further, if the scenario is something similar to this article then it might help:
Partial update of parent page via AJAX (ASP.NET 2.0) on close of a child window - conditionally[^]


这篇关于如何在ASP.NET中从一个用户控件向另一个用户控件发送值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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