Possible Duplicate:
C# - Assignment in an if statement
I find my myself doing the following multiple time
if (e.row.FindControl("myLiteral") is Literal)
{
(e.row.FindControl("myLiteral") as Literal).Text = "textData";
}
Is there way to replace the "if" part and simplify the setter:
(e.row.FindControl("myLiteral") <some operator that combines is and as> .text = "textData";
EDIT:
I should have mentioned this before-
I want to remove the 'if' entirely.
"some operator " should do this internally and set the ".text" only if e.row.FindControl is a literal