Hi. I am having a problem while using < and == with a global variable. The global variable is:
//nr de vlanuri atasate unui port
private object _intNo
{
get
{
return (int)FormState["_intNo"];
}
set
{
FormState["_intNo"] = value;
}
}
objRoot = objXnDoc.SelectSingleNode("/my:ConfPorts/my:txtNo", this.NamespaceManager);
intNo = objRoot.ValueAsInt;
So in this case it return the value as int. But how do I initialize it as int?
When I try to do this
for (int k = 0; k < _intNo; k++)
i get these errors
Operator '<' cannot be applied to operands of type 'int' and 'object'
Operator '==' cannot be applied to operands of type 'object' and 'int'
That is kind a strange. Could anyone help me out? Thank you.