Use of Unassigned local variable

前端 未结 3 1251
离开以前
离开以前 2021-01-26 11:52

I encountered an error. Despite declaring the variables (failturetext and userName) errors still appear. Can anyone please help me?

- Use of Unassigned local va         


        
3条回答
  •  一生所求
    2021-01-26 12:17

    You've declared the variables, but you haven't assigned anything to them before you are attempting to reference their properties. That's the origin of the messages. You've got bigger problems, though, because those represent UI controls and it's highly unlikely that they should be local variables in your function. They probably ought to belong to the page (or form) rather than be declared locally.

提交回复
热议问题