Access Usercontrols server-side objects from code behind in aspx page
-
How to access usercontrol's Server side objects from the aspx codebehind that has teh usercontrol:rolleyes: Ramya
-
i didn't understand your question, server side of every server control is accesible from codebehind sameer sood :-O
I am having a usercontrol say address.ascx with a TextBox named txtStreet Using the address.ascx Usercontrol in Register.aspx page Now my question is how to access the object "txtStreet" in Register.aspx Codebehind file I think my question is clear now. Ramya -- modified at 0:50 Thursday 11th May, 2006
-
I am having a usercontrol say address.ascx with a TextBox named txtStreet Using the address.ascx Usercontrol in Register.aspx page Now my question is how to access the object "txtStreet" in Register.aspx Codebehind file I think my question is clear now. Ramya -- modified at 0:50 Thursday 11th May, 2006
u can create properties for ur controls and eccess text property of that control, i mean that the place where u hv designed control control.ascx there make a public property ex public string Addresstext { get { return control.text; } set { control.text = value; } } or if u wan't the whole control than you have to make attributes public which is not safe there's another solution use System.Web.UI.Control.FindControl(string controlname) USe Msdn to knw about it it finds a control in a control nd returns it scanning by name i hope ur querry has been answered sameer sood :-O