Author: suthish nair | Posted on: 12/31/2008 2:44:49 AM | Views : 249

 

Hi all,

Web page contains more than 80+ controls (HTML/Standard)...

eg:

txt1.Value= "";
txt2.Value= "";
lbl1.InnerText= "";
ddl1.SelectedIndex=0;
ddl2.SelectedIndex=0;

To avoid this much coding lines, came up with this solution... Is there any other better way??, if am wrong please correct it....

string tmpCrtl;
HtmlInputText tmptxt;
HtmlGenericControl tmplbl;
DropDownList tmpddl;

for (i = 10; i < this.Request.Form.Keys.Count - 1; i++)
{
 tmpCrtl = this.Request.Form.Keys[i].ToString();
 if (tmpCrtl.Contains("txt"))
 {
    tmptxt = (HtmlInputText) ...

Go to the complete details ...