.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

NerdDinner Help

Posted By:      Posted Date: September 25, 2010    Points: 0   Category :ASP.Net

Hi Guys

I have been reading this book (Professional.ASP.NET.MVC.2.Scott.Hanselman) to start using MVC, so far its going good an I am enjoying it very much. I have been following the steps described in the book to create the NerdDinner application, Everything went well until I needed to implement the validation. I am leaving the "Title" blank and it throws an error in the NerdDinner.Designer.cs file, this file was automatically generated by visual studio. Here is the line it is complaining about

_Title = StructuralObject.SetValidValue(value, false);



What is causing this error and how can I solve this and prevent it from happening again.



View Complete Post

More Related Resource Links

NerdDinner MVC tutorial, map not positioning correctly like completed MVC sample

I have been studying the NerdDinner MVC tutorial for the past week, and I am at step 11 - the part where  adding a Map is introduced.  I have been following the instructions as closely as possible, and I am at the part Integrating the Map with Create and Edit Forms The tutorial runs the sample app at this point and displays how the map should look -- this part being "Host A Dinner".  In the completed sample (which runs correctly for me) the map displays to the right side of the textboxes of Create.aspx, in some kind of container.  But in the sample I am building - per the tutorial - the map displays in the upper left corner of the page, and the container (for the map) displays below the  textboxes on my Create.aspx -- as per the image here:   I tried stepping through the code in the completed sample, but I was not able to see how the map is positioned in the page.  Any suggesions how to fix this problem -- how to position the map correctly on the page -- how to control the positioning of the map -- would be greatly appreciated. Thanks    

MVC2 NerdDinner - Data no longer saves after adding ViewModel

I am writing this post to document some issues I ran into, and hopefully help anybody else who gets stuck in the same place.  I am creating the NerdDinner application via the Professional ASP.NET MVC 2 book,  and once I got to the ViewModel part (pages 88-91), I noticed none of my data was saving any longer.  I discovered several errors and areas of confusion in these pages of the book, which I will list now. Page 88:  When it says to add the DinnerFormViewModel class, it doesn't say what folder to add it to.  On page 89, the Inherits example (NerdDinner.Controllers.DinnerFormViewModel) implies it was added to the Controllers folder, but if that were so, the code on page 88 would need to use Models.Dinner instead of just Dinner.  No big deal; just put it in Models and change the Inherit statement on page 89 to use NerdDinner.Models.DinnerFormViewModel. Page 89:  At the bottom of the page is some wrong code.  Since the properties of Dinner are now one level deeper, all references to m.Title, m.Country, etc, need to be m.Dinner.Title, m.Dinner.Country, etc.  The statements above the code are also incorrect ("Notice... we are not changing the names of the input elements... the form elements will still be named...") -- the form elements will actually change from "Title", "Country&quo

NerdDinner and logo link

I have uploaded the nerddinner sample to "www.aaa.com/test/nerd". When a mouse is on menu tab such as "Find a host" then the link is shown at the bottom of Internet explorer as "www.aaa.com/test/nerd/Dinner" with the contoller name "Dinner". When the mouse is on the main logo which is on top and left, the link shown as "www.aaa.com". So it direct me to "www.aaa.com" instead of "www.aaa.com/test/nerd"When can I change it? I have tried change the "start url" from the application property, but it did not work.

NerdDinner Delete query

I have been reading this book (Professional.ASP.NET.MVC.2.Scott.Hanselman) to start using MVC, so far its going good an I am enjoying it very much. I have been following the steps described in the book to create the NerdDinner application.

I have a problem with the deleted method, the line the error is on is below and is in BOLD. Can somebody explain why I am getting this error and what is the cause and how can I prevent this from happening in the future.


public void Delete(Dinner dinner)
            foreach (var rsvp in dinner.RSVPs)



Also have a look at the screen shot for a detailed error description.


(NerdDinner) Creating a New SQL Server Express Database


I received an error message like below when Creating a New SQL Server Express Database. any comment would be appreciated.

"A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)"


ps: Great ASP.NET MVC tutorial! thanks!

how can I get the same nerddinner.Entities as mvc sample nerddinner using ADO.NET Entity Framework


DbClick the code behind file of NerdDiner.edmx,It reads "This code was generated from a template." on the top comment lines.

I generate my own .edmx  file automatically with VS2010, just found that the .designer.cs file didnt contains Objectset,Methods as nerddinner does

IDK which template hanselman used to generate this .edmx files,dont tell me he wrote it all by himself!

Shoud .edmx and its code behind file be generated automaticlly without hard-coding?

NerdDinner mvc2 EDMX doesnt generate like Hanselman's book (vb.net)


i was following the nerd dinner book for mvc2 and i cant seem to see how Hanselman got linqs to show up... when i run the ado.net data model, it doesnt look remote ly close to what handelman is producing... is he using a special script to generate this? or does entity model not really work as well with vb.net?

I dont seem to get anything with InsertOrSubmit, DeleteAllOnSubmit, DeleteOnSubmit... This is what i end up getting.

' <auto-generated>
' This code was generated from a template.
' Manual changes to this file may cause unexpected behavior in your application.
' Manual changes to this file will be overwritten if the code is regenerated.
' </auto-generated>

Imports System
Imports System.Data.Objects
Imports System.Data.Objects.DataClasses
Imports System.Data.EntityClient
Imports System.ComponentModel
Imports System.Xml.Serialization
Imports System.Runtime.Serialization

<Assembly: EdmSchemaAttribute("ab894c56-197c-4d36-b52a-8d90fc0f8866")>
#Region "EDM Relationship Metadata"
<Assembly: EdmRela

NerdDinner Error


I'm setting up DinnerRepository class and I get the following error:

//insert/delete methods:

public void Delete(Dinner dinner){

 foreach(var rsvp in dinner.RSVPs){





 the second last line of code is red underlined and the error message is:

Error    1    The best overloaded method match for 'System.Data.Objects.ObjectSet<NerdDinner.Models.RSVP>.DeleteObject(NerdDinner.Models.RSVP)' has some invalid arguments...

Please spell it out as if to a child because I'm new to this and nothing makes any sense right now :(

Nerddinner DinnerFormViewModel problems


I'm working through the Nerddinner exercise in the Professional ASP.NET MVC book and I'm stuck. (Pg 89)

When I change the Edit.aspx view code from:




Now all my HTML is throwing up errors:

Error    1    The type arguments for method 'System.Web.Mvc.Html.LabelExtensions.LabelFor<TModel,TValue>(System.Web.Mvc.HtmlHelper<TModel>, System.Linq.Expressions.Expression<System.Func<TModel,TValue>>)' cannot be inferred from the usage. Try specifying the type arguments explicitly.

Can someone please explain why before I crack up? I'm slowly starting to get a handle on this stuff but without the forum I'd have given up ages ago!

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend