 |
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
 | This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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
|
|
|
|
|

June 18th, 2010, 07:43 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Chapter 6 - <pages> element in web.config
Hi,
I am trying to work the Try It Out, "Creating a New Theme for Your Web Site" that starts on p. 216. On p. 217, instruction 5 has us open the web.config file and locate the <pages> element. I do not have a <pages> element in my web.config so I'm not sure where to put the instruction <pages theme="Monochrome">. I've performed all the Try It Outs up to this point, so I'm not sure why I wouldn't have the <pages> element. Here's my current web.config:
Code:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<add name="ApplicationServices"
connectionString="data source=.\SQLEXPRESS;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnetdb.mdf;User Instance=true"
providerName="System.Data.SqlClient" />
</connectionStrings>
<system.web>
<compilation debug="false" strict="false" explicit="true" targetFramework="4.0" />
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880" />
</authentication>
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider" connectionStringName="ApplicationServices"
enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false"
maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10"
applicationName="/" />
</providers>
</membership>
<profile>
<providers>
<clear/>
<add name="AspNetSqlProfileProvider" type="System.Web.Profile.SqlProfileProvider" connectionStringName="ApplicationServices" applicationName="/"/>
</providers>
</profile>
<roleManager enabled="false">
<providers>
<clear/>
<add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="ApplicationServices" applicationName="/" />
<add name="AspNetWindowsTokenRoleProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
</providers>
</roleManager>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
Any help you can provide would be appreciated! Thanks!
|
|

June 20th, 2010, 02:43 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Are you following these exercises with Visual Studio / VWD 2010? In the 2008 versions, when you create a new web site, the web.config should contain a <pages /> element.
Anyway, <pages /> is a system.web child:
<system.web>
...
<pages theme="Monochrome" />
...
</system.web>
Hope this helps.
Imar
|
|

June 20th, 2010, 06:00 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I am using Microsoft Visual Studio 2010. If the 2010 version does not have pages, how do I code for the themes in this Try It Out?
|
|

June 21st, 2010, 02:08 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
Just add the <pages /> element yourself as a child of system.web, as shown in my previous post.
Hope this helps,
Imar
|
|

June 21st, 2010, 03:27 PM
|
|
Authorized User
|
|
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Ah, okay...I didn't understand the term "child" when you originally wrote it, but now I do! Thanks!
|
|

July 5th, 2010, 11:22 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
Very useful post. I am also upto page 217 while using VS 2010. I assume this:
<pages theme="Monochrome" />
Can go anywhere before the </system.web> line?
__________________
Wind is your friend
Matt
|
|

July 6th, 2010, 02:03 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Yes, it can, as long as it's a direct child of <system.web>, and not of some other node.
Cheers,
Imar
|
|
 |