M
Matze
I have a function that has an Argument of type
System.Web.UI.WebControls.WebControl. I want to set the text-property
of that control. Of course it doesnt work if I cast that control to
(WebControl), because WebControl doesnt have a property Text.
Most Controls that inherit WebControl have text so I guess there must
be an common Interface implemented, but cant figure out what it is.
Goal would be something like:
private function translateCntrl(WebControl cntrl){
(ImaginaryControlTextType)cntrl.Text = translateString( cntrl.Text);
}
at the momemt i have tons of functions like
private function translateCntrl(Label cntrl){
(Label)cntrl.Text = translateString( cntrl.Text);
}
private function translateCntrl(Button cntrl){
(Button)cntrl.Text = translateString( cntrl.Text);
}
System.Web.UI.WebControls.WebControl. I want to set the text-property
of that control. Of course it doesnt work if I cast that control to
(WebControl), because WebControl doesnt have a property Text.
Most Controls that inherit WebControl have text so I guess there must
be an common Interface implemented, but cant figure out what it is.
Goal would be something like:
private function translateCntrl(WebControl cntrl){
(ImaginaryControlTextType)cntrl.Text = translateString( cntrl.Text);
}
at the momemt i have tons of functions like
private function translateCntrl(Label cntrl){
(Label)cntrl.Text = translateString( cntrl.Text);
}
private function translateCntrl(Button cntrl){
(Button)cntrl.Text = translateString( cntrl.Text);
}