Do not assign variables in views. Find a way to do this without this variable. You can set a variable in the controller action.