我们如何将值从.aspx页传递到usercontrol [英] how can we pass the values from .aspx page to usercontrol

查看:72
本文介绍了我们如何将值从.aspx页传递到usercontrol的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是用户控件的新手.
我在用户控件中有复选框列表,并且在我的.aspx页中正在使用用户控件.如果我在.aspx页中检查了该值并单击Submit按钮,则需要将该值传递给我的usercontrol并相应地访问数据.

I''m new to user controls.
I have checkboxes list in usercontrols and I''m using the usercontrol in my .aspx page. If I check the value in my .aspx page and click on submit button, I need to pass the value to my usercontrol and access the data accordingly.

How to know whether the checkbox in my .aspx page is checked or not and access the data accordingly??

推荐答案

您总是可以在用户控件中定义一个属性,然后当页面中的复选框被选中时,更新可在用户控件内部读取的属性.
You can always define a property in your usercontrol and then when checkbox is checked in the page update the property which can be read inside the usercontrol.


这篇关于我们如何将值从.aspx页传递到usercontrol的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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