Click here to Skip to main content
15,893,508 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my web form
contains common details and a web user control called dynamically if user needs
then other block i.e submitting the details of above mentioned controls.
here how can i get the controls values from the web user control page
-------------
i just want to add a piece of code with in the web user controls added based on the user requirement so because of this reason submitting the common details should be done for every time.
bcoz of it the button to save the minimum details should be placed in the web form it self.
In the web user control
i need a table with header row as common and nested table in a 2 columns itself.
the first row Must be filled, if user want to another row by clicking on to the +button add a row to the above table

how can do this one i have tried these individually but im not getting the combination of these thing y i dono?
even i have tried for the materials aslo but i can't make over it.

please can any one help me.
Posted
Comments
Anil Honey 206 25-Oct-11 3:04am    
You want to Find Controls on Your Page and based on that controls you want to find or save the data?
sandhya.T 2011 25-Oct-11 4:55am    
im getting a problem with the nested tables content,
if i run the prg it will that multiple controls having the same id &
the apperance of the table is can't understand by user bcoz they miss places the exact content in a for loop

1 solution

C#
for (int i = 0; i < 9; i++) //Creating Loop for Fisrt Tab.
            {
                Tz_Bud_Fur.IntRoomsTypeId = i + 1;
                //Assining the Fincontrol events As per Controls for First Tab.
                //System.Web.UI.WebControls.TextBox
                Tz_Bud_Fur.IntRoomsinUse = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_0")).Text.Trim());
                Tz_Bud_Fur.IntRoomsGood = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_1")).Text.Trim());
                Tz_Bud_Fur.IntRoomsInRepair = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_2")).Text.Trim());
                Tz_Bud_Fur.IntRoomsUnderConstruct = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_3")).Text.Trim());
                Tz_Bud_Fur.IntSingleSDesks = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_4")).Text.Trim());
                Tz_Bud_Fur.IntDoubleSDesks = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_5")).Text.Trim());
                Tz_Bud_Fur.IntThreeSDesks = Convert.ToInt32(((DevExpress.Web.ASPxEditors.ASPxTextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_6")).Text.Trim());
                Tz_Bud_Fur.IntChairs = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_7")).Text.Trim());
                Tz_Bud_Fur.IntTblForOneStudent = Convert.ToInt32(((System.Web.UI.WebControls.TextBoxTable1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_8")).Text.Trim());
                Tz_Bud_Fur.IntTblForTwoStudents = Convert.ToInt32(((System.Web.UI.WebControls.TextBox)Table1.FindControl("txtNumberOfRoomsAndFurniture_" + i + "_9")).Text.Trim());
                //Method Execute for Insert Statement retreving the Method From Class file(Tz_PrePrimary_BuildingsAndFurniture) for table tblRoomsAndFurniture
                if (Tz_Bud_Fur.InsertRoomsAndFurnitureByType() == 0)
                {

                    //XtraMessageBox.Show(xNew, "Error while saving Details of " + TabPageStudEnrolment.Text.ToString() + ".", "EMIS", MessageBoxButtons.OK, MessageBoxIcon.Error);

                }
 
Share this answer
 
v2

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900