Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | 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 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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
Reply With Quote
  #2 (permalink)  
Old September 12th, 2010, 03:32 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
  #3 (permalink)  
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
Reply With Quote
  #4 (permalink)  
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.
Reply With Quote
  #5 (permalink)  
Old September 12th, 2010, 03:50 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 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!
Reply With Quote
Reply


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



All times are GMT -4. The time now is 03:15 AM.


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