easier way to to type compairisions

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top