c# - Cannot use local variable before it is declared ASP.NET -


i have code this:

[acceptverbs(httpverbs.post)] public actionresult save([bind(prefix="")]person person) {     string s = person.property;     /* ... */ } 

but throws error: "cannot use local variable 'person' before declared".

what simple thing missing?

it receiving error because same variable being declared later in same code block.

according compiler rules, variable reference refer default matching declaration withing same block if same declaration exists outside of block in in logical scope flow.

so in short, check see if variable isnt being declared later on(a couple of lines down) in same application block.


Comments

Popular posts from this blog

windows - Why does Vista not allow creation of shortcuts to "Programs" on a NonAdmin account? Not supposed to install apps from NonAdmin account? -

c++ - How do I get a multi line tooltip in MFC -

unit testing - How to mock PreferenceManager in Android? -