Error message

I am using the following code in my view


CHtml::activeLabelEx($model,'UserName');

i am getting the following error

Fatal error: Call to a member function isAttributeRequired() on a non-object in …

can anybody help me with this…

Obviously your $model doesn’t contain a CModel object. Check the code where you obtain $model.