UserLevel greater than hide field

This public forum is for user-to-user discussions of ASP.NET Maker. Note that this is not support forum.
Post Reply
crash
User
Posts: 148

UserLevel greater than hide field

Post by crash »

I'm trying to hide a field when user level is greater than a certain value

if (CurrentUserLevel() > "4") <fieldname>.Visible = false;

I get this error
Operator '>' cannot be applied to operands of type 'string' and 'string'

My field is an ineteger

It works fine when I use
if (CurrentUserLevel() == "4") <fieldname.Visible = false; but then it's a fixed nunmber


MichaelG
User
Posts: 1095

Post by MichaelG »

You can convert the value to integer first. For example:

if (ConvertToInt(CurrentUserLevel()) > 4)


Post Reply