Click here to Skip to main content
13,511,647 members
Rate this:
Please Sign up or sign in to vote.
I have web application in this am using user control to place it in the table according to row depend on count.Each row has one usercontrol and each usercontrol has 4 textboxes .I am not able to get any of text boxes in the usercontrol when i submit the page.however i am getting the row in which usercontrol placed how can i get the controls id,please have look in my code suggest if i have done any wrong.

MasterPage ctl00 = FindControl("ctl00") as MasterPage;
ContentPlaceHolder cplacehld = ctl00.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
foreach (SeatBookDetails sff in SBD)
    TableRow trow = (TableRow)cplacehld.FindControl("Row_" + sff.SeatRowId.ToString() + "_" + sff.SeatRowno.ToString());
    if (trow != null)
        TextBox txtcust = (TextBox)trow.FindControl("txtcustname");

        if (txtcust != null)

        TextBox txtprofession = (TextBox)trow.FindControl("txtprofession");
        if (txtprofession != null)


This is the one of textbox id in usercontrol when page rendered ctl00_ContentPlaceHolder1_ctl00_txtcustname

and this is one of row id in which these textboxes reside ctl00_ContentPlaceHolder1_Row_1_10

please suggest any other way if it not going to work?
Posted 4-Feb-13 20:25pm

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web02 | 2.8.180417.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100