This project is read-only.

I need some help in an MVC project

Sep 13, 2011 at 3: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 =

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

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

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


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 - grab
Read the full discussion online.
To add a post to this discussion, reply to this email (
To start a new discussion for this project, email
You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on
Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at