Reputation: 453
I have Family.aspx page which contains a parent.ascx user control.
In parent.ascx contain two different user controls namely childA.ascx, childB.ascx and other five textboxes. Applying some logic I make child controls visible true or false. In ChildA and childB user control contain five textbox controls equally.
In Parent.ascx.cs, I have SaveData method which saves entire data in DB. so the catch is how to get ChildA or ChildB textboxes values in parent.ascx.cs so I can call SaveData.
Upvotes: 0
Views: 1774
Reputation: 5723
If ChildA
and ChildB
are your custom user controls, you can expose values retrieved from TextBox
controls as public properties (with some additional processing, if needed) and then read those properties in Parent.ascx.cs
.
Upvotes: 1
Reputation: 47945
You could store data in Session[] from the ChildA.ascx / ChildB.ascx. Than, when you call SaveData, you could manage the data as you want! Just an option, I really don't know the scenario of your web application.
Upvotes: 0