Hi,
Here the code. I prefer to use types then text. Keep the mony ... :-)
1) Class to hold data :
class MyDat
{
public string Text;
public int TabIndex;
public MyDat(string inText,int inTabIndex)
{
Text = inText;
TabIndex = inTabIndex;
}
}
2) Form Load :
private void Page_Load(object sender, System.EventArgs e)
{
// Put user code to initialize the page here
System.Collections.Hashtable oT = new
System.Collections.Hashtable();
HtmlForm theForm = (HtmlForm)this.FindControl("WebForm3");
GetTextBoxes(theForm,oT);
}
3) recursiv function :
private void GetTextBoxes(Control Father,System.Collections.Hashtable
oT)
{
for (int i = 0 ; i< Father.Controls.Count; i++)
{
if (Father.Controls[i] is TextBox)
{
MyDat oData = new MyDat(
((TextBox)Father.Controls[i]).Text,((TextBox)Father.Controls[i]).TabInde
x);
oT.Add(((TextBox)Father.Controls[i]).ID,oData);
}
if (Father.Controls.Count > 0)
{
GetTextBoxes(Father.Controls[i],oT);
}
}
}
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex
http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!