Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.1
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 28th, 2003, 01:52 AM
Registered User
 
Join Date: Sep 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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
 
Old October 30th, 2003, 11:38 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Is the table a client-side or server-side table? If it is a server-side, you may need to access the controls at the TableCell level. The TableCell class contains a Controls collection that you can use to loop through all of the controls in a table cell.

Brian
 
Old November 1st, 2003, 01:04 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 996
Thanks: 2
Thanked 11 Times in 11 Posts
Send a message via Yahoo to melvik
Default

It sould be client-side! but I guess u should access the cells by JavaScript!
HTH.

Always:),
Hovik Melkomian.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Master page control from Content page. angshujit ASP.NET 2.0 Basics 3 January 11th, 2007 06:20 AM
Transfer Values from one page to another page saravananedu ASP.NET 1.0 and 1.1 Basics 6 August 17th, 2005 12:03 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.