I have 2 user control.main user control have a submit button and displaying another usercontrol with 2 textbox. ,after entry data in textbox , while click on submit button in main user control, i want textbox value and fileld name ..please provide a sample code...
Thanks..

Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 5, 2015, 5:43 AM EDT
TextBox tb1 = (TextBox)YourUserControlID.FindControl("TextBox1");
TextBox tb2 = (TextBox)YourUserControlID.FindControl("TextBox2");
string value1 = tb1.Text;
string value2 = tb.Text;
Another way is to define some properties in your UserControl that would store the values from your TextBox like:
then at Button click even you can grab the values like this:
priyaranjan panda12 reputationPosted May 5, 2015, 8:12 PM EDT
Thanks for your reply, but i am using windows application.these solution not working.
please give me some other solution.
Regards,
priyaranjan
Vincent Maverick DuranoRank #238 · 10.3K reputationPosted May 6, 2015, 3:19 AM EDT
Anway I think you could make use of properties to access the values from user control just like in example #2