asp.net mvc 3 - Late binding issue with MVC3 ViewBag in VB.NET -


i'm trying out mvc scaffolding in vb.net mvc3 project , running issue late binding option strict set on (and want on).

this works in c#:

public actionresult create() {     viewbag.possibleteams = context.teams;     return view(); } 

but virtually same code in vb.net:

public function create() actionresult     viewbag.possibleteams = context.teams     return view() end function 

causes compiler error option strict on disallows late binding. took @ documentation here: http://msdn.microsoft.com/en-us/library/system.web.mvc.controllerbase.viewbag(vs.98).aspx wasn't helpful.

i notice new empty application in c# uses viewbag in homecontroller vb.net version uses viewdata, maybe vb.net limitation.

this not trust issue. option strict on disallows late binding. in vb.net, use viewdata object instead , maintain option strict on setting.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -