I need some help in an MVC project

Sep 13, 2011 at 2:33 AM
Hi everybody i need some help

Following is my Controller ( i have create a View of Index method )

Namespace PartyInvites
Public Class HomeController
Inherits System.Web.Mvc.Controller

Function Index() as Viewresult


dim hour as integer = datetime.now.hour

Viewdata("greeting") = (if (hour < 12 , "Good morning "

, " Good afternoon"))

return view()

end function

End class

End namespace

The question is about updating the Index.aspx


I have insert the following code inside the BODY

<body>
<% : ViewData["greeting"] %> , world (from the view) !
</body>

The frst line is underlined ( <%@ Page Language="VB" Inherits="System.Web.Mvc.ViewPage" %> ) is underlined and the following error message can be read on mouse over

property access muss assign to the property or use its value

How do i need to proceed in order to correct the error !

Any help is welcomed

Armand


The frst line is underlined and










From: [email removed]
To: [email removed]
Date: Fri, 10 Jun 2011 23:14:10 -0700
Subject: Re: Anybody developping this project with VB NET ? [mvcmusicstore:240783]

From: jongalloway
Here's the general syntax:
Dim TempList = New List(Of Album)() From {
 New Album With {
	.Title = "The Best Of Men At Work", 
	.Genre = genres.Single(Function(g) g.Name = "Rock"), 
	.Price = 8.99D, 
	.Artist = artists.Single(Function(a) a.Name = "Men At Work"), 
	.AlbumArtUrl = "/Content/Images/placeholder.gif"},
 New Album With {
	.Title = "A Copland Celebration, Vol. I", 
	.Genre = genres.Single(Function(g) g.Name = "Classical"), 
	.Price = 8.99D, 
	.Artist = artists.Single(Function(a) a.Name = "Aaron Copland & London Symphony Orchestra"), 
	.AlbumArtUrl = "/Content/Images/placeholder.gif"}

TempList.ForEach(Function(a) context.Albums.Add(a))
You can download the completed VB.NET code from http://mvcmusicstore.codeplex.com/releases/view/64379 - grab MvcMusicStore-v3.0-VB.zip
Read the full discussion online.
To add a post to this discussion, reply to this email (mvcmusicstore@discussions.codeplex.com)
To start a new discussion for this project, email mvcmusicstore@discussions.codeplex.com
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com