Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4.5 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-31180-6
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 22nd, 2014, 12:06 AM
Authorized User
Points: 276, Level: 5
Points: 276, Level: 5 Points: 276, Level: 5 Points: 276, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default Namespaces

Hi Imar,

In (Chapter 5 Namespaces Pg. 184) you introduce namespaces and describe where the Page class lives.

In (Chapter 6 Creating Consistent Looking Websites Pg. 221) you describe using a BasePage inheriting from System.Web.UI.Page. And In later chapters you build on this idea and reference this BasePage.

In what namespace does IT(BasePage or MyBasePage) live? When you create classes in your project how do we know what their full names are?

Thanks.
 
Old January 22nd, 2014, 03:59 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

The BasePage lives in the "root namespace" (which is ASP) since you haven't supplied your own namespace. The root namespace is an implicit namespace that Visual Studio / ASP.NET make available for web site projects. The same applies to your other classes such as the Calcualator so they can all see each other because they all live in the same implicit namespace.

If you put your classes in a namespace, their full names are Name.Space.ClassName.

What does MyBasePage refer to?

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old January 22nd, 2014, 11:26 PM
Authorized User
Points: 276, Level: 5
Points: 276, Level: 5 Points: 276, Level: 5 Points: 276, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2012
Posts: 39
Thanks: 4
Thanked 1 Time in 1 Post
Default

Interesting. So it resides adjacent to the root namespace "System"?
(
i.e.
System.Web
ASP.MyBasePage
)

How would you address it with it's full name?

The MyBasePage is the name of the template web form you have us create in Chapter 6, Pg. 227. It inherits from BasePage, which in turn inherits from System.Web.UI.Page. The BasePage class has two additional event handlers.
 
Old January 23rd, 2014, 11:32 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

No, it resides in just ASP. System.Web is another namespace, with all the standard web-related .NET types.

MyBasePage is not a type; it's purely a temporary solution. BasePage is a type, and lives in the implicit ASP namespace.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!




Similar Threads
Thread Thread Starter Forum Replies Last Post
help please on namespaces anthonym XSLT 11 January 31st, 2012 12:12 PM
Namespaces lustigon BOOK: Beginning ASP.NET 4 : in C# and VB 1 October 4th, 2010 02:40 AM
Namespaces Amateur BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 November 27th, 2006 05:19 PM
namespaces anchal C# 1 July 3rd, 2006 02:53 PM
NAMESPACES - WHAT ARE THEY? p_nut33 C# 2 July 31st, 2003 03:18 AM





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