p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 (http://p2p.wrox.com/forumdisplay.php?f=472)
-   -   Code and no explation. (http://p2p.wrox.com/showthread.php?t=76265)

andresb September 21st, 2009 03:42 PM

Code and no explation.
 
Hello,

There is code in your samples that is not explained anywhere in the book. For example, in p. 136, ForgotPassword.aspx:

Inherits="System.Web.Mvc.ViewPage<TheBeerHouse.Mod els.UserInformation>"

What is its purpose? How did it get there? Some views have it, others do not, why?

Should I consult MSDN to figure it out?

I am finding one cannot follow the examples page by page.

Steve S September 22nd, 2009 12:31 AM

Andres,

The inherits property is on each view page and defines the class that will be used to pass data into the view and back out. In the example you site the userInformation class in the Model is being used. If you check the UserController and look at the ForgotPassword ActionResult you will see that the veiw uses a new UserInformation. So an empty object from the UserInformation class is initially passed to the view.

The POST ActionResult for the ForgotPassword accepts two properties from the userInformation object used in the view, the user name and the secret Answer.

I agree that it is difficult to try and follow the book page by page and end up with working code like was possible with the previous version of this book. However, if you go through the book and with the source code at the same time it should become clear; and you will learn the material that much better for having to strive to understand it. It is a fine line that publishers and authors have to tread, make everything very explicit and the book has to many pages and costs to much to produce; and the reader doesn't learn the underlying principles as well since they are doing rote work. On the other hand if the book is not explicit enough it can be much harder to follow along or understand the principles which doesn't help generate sales. Overall I think this version of the book has erred on not being explicit enough; in some places it is not clear enough in others and to wordy in others, but I'm muddling through it non the less.


Steve

andresb September 30th, 2009 02:11 PM

Thank you Steve for your explanation. Also thank you for your understanding. I wish this book was as well detailed as the previous Bellinaso's book.


All times are GMT -4. The time now is 02:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.