Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : 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 September 11th, 2010, 04:09 PM
Authorized User
Points: 69, Level: 1
Points: 69, Level: 1 Points: 69, Level: 1 Points: 69, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default A namespace cannot directly contain members such as fields

I have this error message when I make the skin in page 234,
"A namespace cannot directly contain members such as fields or methods", seems like IntelliSense doesn't recognize the code which is
Code:
<asp:Button CssClass=”MyButton” BackColor=”#7a70a4” runat=”server” />
although I made the configuration to be able to use intellisense but it doesn't recognize the <asp tag
 
Old September 12th, 2010, 03: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

Hi there,

What's the extension of the file that contains this code? And what editor did you hook it up to?

Normally, you get this error for code files (like .cs or .vb) when they contain invalid code so my guess is that VWD tries to interpret this as code, not as markup somehow....

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 September 12th, 2010, 03:39 AM
Authorized User
Points: 69, Level: 1
Points: 69, Level: 1 Points: 69, Level: 1 Points: 69, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reply

I added a skin folder to the Monochrome in the theme folder so it's now like :

-App_Themes
-Monochrome
 
Old September 12th, 2010, 03:44 AM
Authorized User
Points: 69, Level: 1
Points: 69, Level: 1 Points: 69, Level: 1 Points: 69, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2010
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Reply

I added a skin folder to the Monochrome in the theme folder so it's now like :

-App_Themes
-Monochrome
-Skins
-Button.skin
and i went to Tools>>Options>>Text Editor>>File Extension and added skin in the Extension field and chose Microsoft visual c# in the editor drop down list.

but still I have a red line below the < in the beginning of the <asp:button tag.

I have also another question, how will the buttons capture this skin? where did we identify a class called .mybutton? when we added new button, it doesn't have this class by default for sure and I didn't notice we added this class to it, so how did it turned into purple?

Thanks a lot.
 
Old September 12th, 2010, 03:50 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

Quote:
I added a skin folder to the Monochrome in the theme folder so it's now like :
Take a look at page 233, directly under the heading Creating a Skin File. You can't save them to sub folders.

Quote:
and chose Microsoft visual c# in the editor drop
Ah, that explains the error. But why would you want to do that? It's not C# code, it's markup. Take a look at page 234 for the proper instructions on how to do this.

Quote:
I have also another question, how will the buttons capture this skin?
It works the other way around. .NET sees the skin, and applies the CssClass on the skin button to the button in the HTML. Take a look at page 235 for an explanation.

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
error CS0234: The type or namespace name 'Xml' does not exist in the namespace 'Syste shailesh_kumar C# 2008 aka C# 3.0 8 August 20th, 2009 03:11 AM
Need to convert an existing namespace and add new namespace to the SOAP xml Prabeen XSLT 10 April 28th, 2009 10:18 AM
I can't send email to other members ali3dt Forum and Wrox.com Feedback 2 January 28th, 2008 02:12 AM
Members list happygv Forum and Wrox.com Feedback 9 April 10th, 2007 11:33 AM
Listing members quiksilverhg Excel VBA 1 October 6th, 2005 05:09 AM





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