如何将值从一个用户控件传递到另一个用户控件

如何将值从一个用户控件传递到另一个用户控件

问题描述:

你好,

我是asp.net中的usercontrol的新手.我知道如何在网页中创建和添加用户控件.但是,我不知道如何将值从一个用户控件传递到另一个用户控件.

例如,在我的网站中,我使用了2个用户控件1)在数据列表中显示用户相册
2)编辑/创建用户相册.

因此,每当用户单击usercontrol 1中的编辑相册时,整个相册说明都应在usercontrol2中打开.因此,我必须将值从usercontrol1传递给usercontrol2.

请帮帮我.
谢谢!

Hello,

I Am novice to usercontrol in asp.net. i know how to create and add usercontrol in web page. But, i don''t know how to pass values from one user control to another usercontrol.

For e.g in my website i used 2 user controls 1)which show users album in datalist
2)edit/create user album.

So, whenever user click on edit album in usercontrol 1 then whole album description should open in usercontrol2. so, i have to pass values from usercontrol1 to usercontrol2.

Please help me.
Thanks!

最简单的方法是公开属性.

请看以下示例示例:此处. [
Simplest would be by exposing Properties.

Have a look at this sample example: here.[^]