nerddinner

ASP.NET MVC: How to transfer more than one object to View method?

寵の児 提交于 2020-01-03 21:09:01
问题 I finished NerdDinner tutorial and now I'm playing a bit with project. Index page shows all upcoming dinners: public ActionResult Index() { var dinners = dinnerRepository.FindUpComingDinners().ToList(); return View(dinners); } In DinnerRepository class I have method FindAllDinners and I would like to add to above Index method number of all dinners, something like this: public ActionResult Index() { var dinners = dinnerRepository.FindUpComingDinners().ToList(); var numberOfAllDinners =

Can't open NerdDinner project in vs2008

血红的双手。 提交于 2020-01-03 17:27:23
问题 NerdDinner.csproj won't load in vs2008 sp1 with .net 3.5 sp1. Am I not up-to-date on these tools or something? It complains this project type not supported on this installation. 回答1: Do you have the ASP.NET MVC Framework installed? If not, you need it. NerdDinner is an example of an MVC Framework project, and you won't be able to open it or run it without the ASP.NET MVC Framework installed. You can find the appropriate installation information at http://www.asp.net or more specifically http:

Can't open NerdDinner project in vs2008

a 夏天 提交于 2020-01-03 17:27:18
问题 NerdDinner.csproj won't load in vs2008 sp1 with .net 3.5 sp1. Am I not up-to-date on these tools or something? It complains this project type not supported on this installation. 回答1: Do you have the ASP.NET MVC Framework installed? If not, you need it. NerdDinner is an example of an MVC Framework project, and you won't be able to open it or run it without the ASP.NET MVC Framework installed. You can find the appropriate installation information at http://www.asp.net or more specifically http:

The current request for action 'Index' on controller type 'DinnersController' is ambiguous between the following action methods [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-23 07:58:23
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . I am getting this error after trying to implement paging support. I am on this step of the html tutorial: http://nerddinnerbook.s3.amazonaws.com/Part8.htm 回答1: The error you are getting tells that ASP.NET MVC has

ASP.NET MVC 2 UpdateModel() is not updating values in memory or database

☆樱花仙子☆ 提交于 2019-12-22 22:22:19
问题 I am new to MVC, and so am working through the NerdDinner tutorial, here. In particular, I'm running into problems with the use of the UpdateModel method, which is explained in the part five of that tutorial. The problem is, when I try to edit the value of a dinner object using the UpdateModel method, the values do not get updated, and no exceptions are thrown. Oddly, I am not having any trouble with the Create or Delete features that are illustrated in the tutorial. Only the update feature

What is ModelState.IsValid valid for in ASP.NET MVC in NerdDinner?

北慕城南 提交于 2019-12-17 00:00:52
问题 On the NerdDinner example of Professional ASP.NET MVC 1.0 there's a method to create a new dinner as copied bellow (page 89 of the free NerdDinner version). There it checks ModelState.IsValid for true. It seems to check if the model is valid for the database (that is, it catches data type conversions, like dates with invalid format, but not business rules). Is that true? When submitting the form, if you have an error in the date, ModelState.IsValid will be false and you'll get back an error,

Nerd Dinner validation rules question

风格不统一 提交于 2019-12-13 04:27:38
问题 In the NerdDinner tutorial, Step 5, mid way down under Complete Edit Action Method Implementations there is a paragraph: The nice thing about our Edit implementation is that neither our Controller class nor our View template has to know anything about the specific validation or business rules being enforced by our Dinner model. We can add additional rules to our model in the future and do not have to make any code changes to our controller or view in order for them to be supported. This

ASP.NET MVC: Implementing an OpenID sign-in page ala NerdDinner v2

。_饼干妹妹 提交于 2019-12-12 14:14:42
问题 Consider the log in page on NerdDinner.com: http://www.nerddinner.com/Account/LogOn Some nice features: jQuery effects on the OpenID choice popups for the other major providers Is this revision of the NerdDinner AccountController and its View available for public download? How would you reinvent this implementation? Any code you can post would be fine. Calling Jon Galloway! 回答1: All of NerdDinner is available for download from CodePlex. NerdDinner uses DotNetOpenAuth for its OpenID support,

NerdDinner form validation DataAnnotations ERROR in MVC2 when a form field is left blank

只愿长相守 提交于 2019-12-11 01:09:18
问题 Platform: Windows 7 Ultimate IDE: Visual Studio 2010 Ultimate Web Environment: ASP.NET MVC 2 Database: SQL Server 2008 R2 Express Data Access: Entity Framework 4 Form Validation: DataAnnotations Sample App: NerdDinner from Wrox Pro ASP.NET MVC 2 Book: Wrox Professional MVC 2 Problem with Chapter 1 - Section: "Integrating Validation and Business Rule Logic with Model Classes" (pages 33 to 35) ERROR Synopsis: NerdDinner form validation ERROR with DataAnnotations and db nulls. DataAnnotations in

ASP.NET MVC: How many repositories?

别来无恙 提交于 2019-12-09 15:41:39
问题 I am in the process is designing a website in ASP.NET MVC and am perhaps a little confused as to the exact nature of a repository. Following the NerdDinner example, my site should have one repository which serves up the entities as I need them. However, I have also heard that you should have different repositorys that deal with specific sets of related entities....? In the case of my site, there will be a number of entities (around 15 tables) yet the majority are all related. Is it ok /