Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950
This is the forum to discuss the Wrox book ASP.NET MVC Website Programming Problem Design Solution by Nicholas Berardi, Al Katawazi, and Marco Bellinaso; ISBN: 9780470410950
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET MVC Website Programming Problem Design Solution ISBN: 9780470410950 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 24th, 2010, 03:56 PM
Authorized User
 
Join Date: Dec 2009
Posts: 12
Thanks: 1
Thanked 0 Times in 0 Posts
Default Why do I have to write the entire path?

In thebeerhouse project you just have to write

foreach(Article article in ViewData.Model)

but I have to write foreach(TheBeerHouse.Models.Article article in ViewData.Model)

for it to know what I mean. Why is that?
  #2 (permalink)  
Old January 27th, 2010, 10:48 AM
Authorized User
 
Join Date: Jan 2010
Posts: 12
Thanks: 0
Thanked 1 Time in 1 Post
Default Namespace in web.config

Make sure to add a reference in your web.config. This will allow you to omit TheBeerHouse.Models in your web pages.

<namespaces>
....
<add namespace="TheBeerHouse.Models"/>
</namespaces>

Also, you don't have to use ViewData.Model you can just use Model
The Following User Says Thank You to midavis For This Useful Post:
Jova (January 27th, 2010)
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need Help with path for loading Pics (app.path) Tabbasum Beginning VB 6 2 November 15th, 2007 04:57 AM
Implementing the all-path shortest path problem bitwords XSLT 1 December 6th, 2006 11:37 AM
using app.path in database path and filename kd8con VB Databases Basics 2 October 25th, 2006 11:45 AM
Convert logical path to absolute path zoostar J2EE 1 April 15th, 2005 10:36 AM
How to search entire DB[?] Blaise SQL Server 2000 7 June 11th, 2003 09:41 AM



All times are GMT -4. The time now is 10:11 PM.


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