nerddinner

NerdDinner exceptions and custom errors

In this tutorial in Details action Scott uses if (dinner == null) return View("NotFound"); else return View("Details", dinner); to return 404 Not Found message view. But in my downloaded source code for NerdDinner there are these lines: if (dinner == null) { return new FileNotFoundResult { Message = "No...

NerdDinner tutorial - missing explanation for Helper methods?

I've started reading NerdDinner tutorial from scratch. While reading and coding application I came to part about some Helper methods and there was one example of some class (AddRuleViolations) but there was no any explanation WHERE to add this class. So I skipped this one and continued with tutorial without using this class later in code...

Nerd Dinner not catching errors

I'm at the "Handling Edit Errors" (page 67) in chapter 1 of the Professional ASP.NET MVC 1.0 book and I'm running into a problem. The problem is that when I'm editing a dinner and I click save, it's not catching any of the form errors, even though I left the Title blank. Neither UpdateModel(dinner) or dinnerRepository.Save() throws an ...

Following NerdDinner tutorial, don't allow duplicate

My sql database doesn't allow 2 records to be added with the same number. If I try to create a record with a previously used number or edit a record to use a previously used number, it doesn't allow it and returns to the edit/create page with an asterisk by the subcontract number field. I would like to add a Rule Violation for this so ...

mvc 2.0 updatemodel and my ID Column

Hello, I have created a create view within my MVC 2.0 Application and by default it included a field for the integer ID Column. This is definitely a field i do not need. If i remove the field and use updatemodel when trying to create the object in code, will something break because it doesnt see my ID column data being passed in, even...

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

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...

AJAX Search like nerddinner.com

Hi, can somebody tell me how it's needed to change the nerdDinner project, that the 'location-search' which is an JSON-Based Ajax call, works like http://www.nerddinner.com/#where=london so that the search-location parameter will be added to the queryString and make the location browsable? Thanks a lot, dan ...

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

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...

Html.Encode question

I'm working through the NerdDinner MVC tutorial and came across this and was wondering about. On page 62 of the pdf they have the following: <asp:Content ID="Main" ContentPlaceHolderID="MainContent" runat="server"> <h2>Upcoming Dinners</h2> <ul> <% foreach (var dinner in Model) { %> <li> <a h...

NerdDinner Exception Handling

I'm working through the NerdDinner ASP.NET MVC 1.0 example. I have it all working apart from Exception handling. I've modified it very slightly for my own benefit, but basically, when I create a new record that violates a validation rule, I get an ApplicationException being thrown - instead of the form highlighting the incorrect field....

NerdDinner difficulties

Hello guys, I'm having a problem with the Create method of the NerdDinner tutorial, which is very good BTW. As you can see here http://nerddinnerbook.s3.amazonaws.com/Part5.htm in the Create method, he removed the ID field of the aspx page. I did that too, but I cannot add any dinners because I get a primary key violation. How is Ne...

NerdDinner Visual Web Developer 2010 Settings

I'm following steps of the NerdDinner tutorial. In the dinner Model class where I have error and validation handling for CRUD instead of error notifications in browser I get some kind of debugger dialog. Why is that? ...

Nerd Dinner - labels for textfields are broken

Hello. I am trying to learn ASP.NET (since I know C#) so I have decided to follow Nerd Dinner Tutorial. I am having trouble in part 5 of tutorial. I exactly followed tutorial, even pasted whole code to my visual studio, but when I was supposed to create EDIT VIEW, my result was different than one in tutorial. Please take a look at follo...

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

Hello, 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 update...

Dependency Injection, IoC and Mocking finally explained in a simple and understandable way!

I've been banging my head against the wall trying to understand these concepts for a week now. I was really surprised when I came across with a very understandable and simple explanations of these concepts in the ASP.NET MVC NerdDinner application tutorial. I suggest this to anyone struggling to have that 'aha' moment. http://nerddinner...

Common MVC 2 Pitfalls

I'm surprised this hasn't been asked before...or maybe I just don't see it. Anyway, I'm finally straying from the comfort of ASP.NET Web Forms and exploring the world of MVC2. I've done the nerdinner walk-through and it was fairly straightforward. Now I am getting a little more adventurous and building an MVC2 app on my own and would li...

Nerddinner inserting longitude and latitude to database MVC

i am facing a problem in the nerddinner, what i am facing: in the DinnerForm.ascx there is a javascript code $(document).ready(function () { NerdDinner.EnableMapMouseClickCallback(); $("#Dinner_Address").blur(function (evt) { //If it's time to look for an address, // clear out the Lat and Lon ...

Asp.net MVC validation for non-strings

I originally built my site in MVC 1.0 using the NerdDinner tutorial as a basic outline. Many of the early design decisions were made simply b/c "that's how NerdDinner did it" Since then, it has really grown and was converted to 2.0. My validation still works the way NerdDinner did it and is very minimal, so although I've read about ot...

Is the Nerddiner walk-through suitable for ASP.NET MVC 2?

I'm keen to teach myself ASP.NET MVC 2 (coming from a heavy embedded or rich GUI background). If have found the nerddiner walk-through but it is still for ASP.NET MVC 1. The codeplex downloads have been updated to MVC 2 but the link for the PDF goes back to the MVC 1 book. Is it even possible to follow the walk-through in MVC 2? If s...

What is `confirmButton` in NerdDinner's ActionResult Delete?

In the NerdDinner MVC app demo, there is confirmButton defined when setting up ActionResult Delete: public ActionResult Delete(int id, string confirmButton) { What is confirmButton for, as it is not used in the code? I assumed it returned the name of the submit button that was clicked, but it is just a blank string. How can you get wh...