c# - Calling a user control from a back end page -
i have input text box , button runs on myapppage.aspx , when user clicks button want populate user control page. how call control in embedded usercontrol.ascx file in .net?
you can provide public property in usercontrol
exposes control controller (f.e. page
). since you've mentioned literal
control:
public string text { get{ return myliteral.text; } set{ myliteral.text=value; } }
now can use page:
myusercontrol.text = "hello world";
i provide as necessary. not return control itself. still change control type without breaking code. example if want replace literal
textbox
or label
.
Comments
Post a Comment