Getting all the control values of page
i am just trying to write some generic function to get all the values of the controls of a page .
in my page iam basically having one table with three rows one is for header and one for body and last one for footer, i want to capture all the values of body for that iam writing something like this...
foreach(Control myControl in Page.Controls)
{
foreach(Control myControl1 in myControl.Controls)
{
foreach(Control myControl2 in myControl1.Controls)
{
switch(myControl2.GetType().ToString())
{
case "System.web.ui.TextBox":
string strText = ((TextBox)myControl).Text;
string strID = ((TextBox)myControl).ID;
break;
case "System.Web.UI.Checkbox":
bool boolCheck = ((CheckBox)myControl).Checked;
break;
........ like this.....
}
}
}
}
iam not able to get the values out of the table...
wat actually is the procedure to retrieve the fields, can u help me out of this
vishnu
|