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

April 24th, 2011, 05:48 PM
|
|
Authorized User
|
|
Join Date: May 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Error
Hello,
I'm on Chapter 17 page 649, and working on the Try it Out 'Working with Other User's Profiles', but when I request the Default.aspx from the PhotoAlbums folder I get this error message:
'The type or namespace name 'Generics' does not exist in the namespace 'System.Collections' (are you missing an assembly reference?)'
I don't know how to correct this, any ideas please, help much appreciated.
Thanks
Paul
|
|

April 25th, 2011, 09:59 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
I think you made a mistake in setting up the property in web.config. Can you post the code for that file?
Cheers,
Imar
|
|

April 25th, 2011, 10:47 AM
|
|
Authorized User
|
|
Join Date: Dec 2004
Posts: 69
Thanks: 0
Thanked 5 Times in 5 Posts
|
|
The answer is in your question itself... You given the namespace as "System.Collections.Generics" but it actually is "System.Collections.Generic". Check it out...
__________________
Thanks in advance.
Regards,
Senthil Kumar M.
|
|

April 25th, 2011, 10:48 AM
|
|
Authorized User
|
|
Join Date: May 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Code in web.config
Hi Imar,
Here's the code in the web.config file
Code:
<?xmlversion="1.0"encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<connectionStrings>
<addname="PlanetWroxConnectionString1"connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PlanetWrox.mdf;Integrated Security=True;User Instance=True"providerName="System.Data.SqlClient" />
<addname="PlanetWroxEntities"connectionString="metadata=res://*/App_Code.PlanetWrox.csdl|res://*/App_Code.PlanetWrox.ssdl|res://*/App_Code.PlanetWrox.msl;provider=System.Data.SqlClient;provider connection string="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PlanetWrox.mdf;Integrated Security=True;User Instance=True;MultipleActiveResultSets=True""providerName="System.Data.EntityClient" />
</connectionStrings>
<system.web>
<profile>
<properties>
<addname="FirstName" />
<addname="LastName" />
<addname="DateOfBirth"type="System.DateTime" />
<addname="Bio" />
<addname="FavouriteGenres"type="System.Collections.Generics.List`1[System.Int32]" />
</properties>
</profile>
<membership>
<providers>
<clear />
<addname="AspNetSqlMembershipProvider"type="System.Web.Security.SqlMembershipProvider, System.Web, 
						 Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"connectionStringName="LocalSqlServer"enablePasswordRetrieval="false"enablePasswordReset="true"requiresQuestionAndAnswer="false"applicationName="/"requiresUniqueEmail="false"passwordFormat="Hashed"maxInvalidPasswordAttempts="5"minRequiredPasswordLength="6"minRequiredNonalphanumericCharacters="1"passwordAttemptWindow="10"passwordStrengthRegularExpression="" />
</providers>
</membership>
<roleManagerenabled="true" />
<authenticationmode="Forms" />
<pagestheme="Management">
<controls>
<addtagPrefix="Wrox"tagName="Banner"src="~/Controls/Banner.ascx" />
</controls>
</pages>
<compilationdebug="false"targetFramework="4.0">
<assemblies>
<addassembly="System.Security, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
<addassembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
<addassembly="System.Data.Entity.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
</assemblies>
<buildProviders>
<addextension=".edmx"type="System.Data.Entity.Design.AspNet.EntityDesignerBuildProvider" />
</buildProviders>
</compilation>
</system.web>
<system.net>
<mailSettings>
<smtpdeliveryMethod="Network"from="Paul Hudson <[email protected]>">
<networkenableSsl="true"userName="[email protected]"password="BobbyFischer2011$"host="smtp.gmail.com" />
</smtp>
</mailSettings>
</system.net>
<locationpath="Management">
<system.web>
<authorization>
<allowroles="Managers" />
<denyusers="*" />
</authorization>
</system.web>
</location>
<locationpath="My Profile.aspx">
<system.web>
<authorization>
<denyusers="?" />
</authorization>
</system.web>
</location>
<location>
<system.web>
<authorization>
<denyusers="?" />
</authorization>
</system.web>
</location>
<locationpath="NewPhotAlbum.aspx">
<system.web>
<authorization>
<denyusers="?"/>
</authorization>
</system.web>
</location>
</configuration>
Thanks
Paul
|
|

April 25th, 2011, 10:51 AM
|
|
Authorized User
|
|
Join Date: May 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Generics to Generic - Solved!
Thanks for your help, Imar and WhiteRainbow!
Solved it now, thank you
Paul
|
|
 |
|