T
Tim Cowan
Hi
I was wondering if someone could help me change these ifs to a switch
statement. I tried but I can't make it work.
Thanks Tim
Code below:
protected void SetThisControl(System.Web.UI.Control WebControl1)
{
if (WebControl1 is BaseValidator)
{
//Do stuff
}
if (WebControl1 is Label)
{
//Do something
}
if (WebControl1 is Button)
{
//Do something
}
if (WebControl1 is DataGrid)
{
//Do something
}
}
I was wondering if someone could help me change these ifs to a switch
statement. I tried but I can't make it work.
Thanks Tim
Code below:
protected void SetThisControl(System.Web.UI.Control WebControl1)
{
if (WebControl1 is BaseValidator)
{
//Do stuff
}
if (WebControl1 is Label)
{
//Do something
}
if (WebControl1 is Button)
{
//Do something
}
if (WebControl1 is DataGrid)
{
//Do something
}
}