0

i am developing application and i have set some html control which are runat="server" on code behind i need to change there text,i made htmlcontrol[] array which contain those control now the problem which i am facing that it didn't showing my text property so that i can change there text dynamically my code is

HtmlControl[] htmlctrl = { ctl1,ctl2,ctl3,ctl4 };

        foreach (HtmlControl ctl in htmlctrl)
        {


        }

Can anyone help me out.

Emaad Ali
  • 1,483
  • 5
  • 19
  • 42

1 Answers1

2

you must type-cast html-control (which is textbox) to TextBox, in order to get Text property shown.

iTSrAVIE
  • 846
  • 3
  • 12
  • 26
  • please typecast htmlcontrol to htmlgeneric control in such case, and then use INNERTEXT OR INNERHTML properties, eg: HtmlGenericControl gen = ((HtmlGenericControl)(ctl)); – iTSrAVIE Jan 17 '11 at 11:02