I am working with ASP MVC Preview 4 using VB and have encountered an issue I am trying to use of the View class's Model attribute in the in-line code in the HTML markup. When I try that,
I get a syntax error saying "'model' is not a member of 'System.Web.UI.WebControls.View'"
I suspect the a namespace is not being added correctly via the templates for the MVC View Content Page in VB. However, I cannot find any docs that tell me what namespace should be included.
Does anyone have that information?
burrowsuw
Member
121 Points
37 Posts
View.Model using VB
Aug 11, 2008 01:10 AM|LINK
I am working with ASP MVC Preview 4 using VB and have encountered an issue I am trying to use of the View class's Model attribute in the in-line code in the HTML markup. When I try that, I get a syntax error saying "'model' is not a member of 'System.Web.UI.WebControls.View'"
I suspect the a namespace is not being added correctly via the templates for the MVC View Content Page in VB. However, I cannot find any docs that tell me what namespace should be included. Does anyone have that information?
Thanks .. bill b
Paul Linton
Star
13421 Points
2535 Posts
Re: View.Model using VB
Aug 11, 2008 03:24 AM|LINK
I think you want ViewData.Model not View.Model
good luck
burrowsuw
Member
121 Points
37 Posts
Re: View.Model using VB
Aug 11, 2008 02:34 PM|LINK
Hi Paul,
I am not seeing ViewData as an option in intellisense.
bill
tdavisjr
Member
615 Points
137 Posts
Re: View.Model using VB
Aug 11, 2008 02:37 PM|LINK
What does your code-behind file look like?
burrowsuw
Member
121 Points
37 Posts
Re: View.Model using VB
Aug 11, 2008 02:40 PM|LINK
To respond to my own post [:)]
I needed to do 2 things:
1. Rebuild project.
2. Use ViewData, not View as the object. bill b