Click here to Skip to main content
12,749,046 members (39,425 online)
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 21: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 | Mobile
Web01 | 2.8.170215.1 | Last Updated 5 Feb 2013
Copyright © CodeProject, 1999-2017
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