M
Mufasa
I have a page that has a master page. I'm writing generic code to find
multiple controls on the page (I have a number of controls called tbName1,
tbName2, tbName3, ..., tbName20) and rather than doing all the same code for
all 20 fields, I thought I'd write something that loops through all of the
fields 'finding' the control as it goes. But if I do:
TextBox tbNew = (TextBox) this.FindControl("tbName1");
It comes back as null. If I look at the source generated within the browser,
the field is now called something like ctl00$MainPage$tbName2. Is there
anyway to tell the system to fine tbName2 without putting the prefix stuff
on it which I assume could change?
TIA - Jeff.
multiple controls on the page (I have a number of controls called tbName1,
tbName2, tbName3, ..., tbName20) and rather than doing all the same code for
all 20 fields, I thought I'd write something that loops through all of the
fields 'finding' the control as it goes. But if I do:
TextBox tbNew = (TextBox) this.FindControl("tbName1");
It comes back as null. If I look at the source generated within the browser,
the field is now called something like ctl00$MainPage$tbName2. Is there
anyway to tell the system to fine tbName2 without putting the prefix stuff
on it which I assume could change?
TIA - Jeff.