J
John Spiegel
Hi all,
I'm putting together some generic function classes, a somewhat specific case
I'm working toward is C# code to support ASP.NET pages. But my question is
more general...
I'd like to build a class that handles common functions that pages may want
to use. There may be other options like style sheets, but this is partially
educational as well as intending on having practical use. Let's say I'd
like to be able to have one chunk of code that changes the Text property of
WebControls. If C# weren't strongly typed, I could do something like:
protected void ChangeText( Control, NewText )
{
Control.Text = NewText;
}
Is this possible or am I looking at having a constructor for each class of
control I might want this to support?
protected void ChangeText( Label Control, string NewText )
{
Control.Text = NewText;
}
protected void ChangeText( TableCell Control, string NewText )
{
Control.Text = NewText;
}
....
TIA,
John
I'm putting together some generic function classes, a somewhat specific case
I'm working toward is C# code to support ASP.NET pages. But my question is
more general...
I'd like to build a class that handles common functions that pages may want
to use. There may be other options like style sheets, but this is partially
educational as well as intending on having practical use. Let's say I'd
like to be able to have one chunk of code that changes the Text property of
WebControls. If C# weren't strongly typed, I could do something like:
protected void ChangeText( Control, NewText )
{
Control.Text = NewText;
}
Is this possible or am I looking at having a constructor for each class of
control I might want this to support?
protected void ChangeText( Label Control, string NewText )
{
Control.Text = NewText;
}
protected void ChangeText( TableCell Control, string NewText )
{
Control.Text = NewText;
}
....
TIA,
John