Passing values from one Usercontrol to another UserControl !
hie guys开发者_JS百科.
I have ParentPage which contains 4 user controls and i have user dropdown on each control. whenever i change the selected index .. all user control should populate according to the selected value of user. Can anyone kindly tell me.. how to pass the values to different usercontrol at same time ... Thanks !!!!!
You could create a UserControl base class with the common properties. The properties would need to wrap a session variable, which would be common to each.
eg:
public string Text
{
get
{
if (Session["UserControlText"] == null || Session["UserControlText"].ToString().Trim() == String.Empty)
{
Session["UserControlText"] = String.Empty;
}
return Session["UserControlText"].ToString().Trim();
}
set
{
Session["UserControlText"] = value;
}
}
精彩评论