easier way to to type compairisions

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have:
if gvr.FindControl(objPosNeg1).GetType.ToString =
"System.Web.UI.WebControls.label" then
....
....
....
end if
where gvr is a gridviewrow, objPosNeg is an object and in this case the
object is a label. On other occations it will be a hyperlink.
I'd like to do a direct type compairison, but can't find the way to do it.
Is there a way to do:
IF obj.typeof = (or is) ...WebControls.label THEN
....
....
....
ELSE IF
 
i should have included that i know i can use:
gvr.FindControl(objPosNeg1).Equals("System.Web.UI.WebControls.Label")
but it's just a flavor of the same thing.

THANKS
KES
 
Back
Top