Wrox Programmer Forums
|
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
 
Old January 29th, 2010, 10:32 PM
Registered User
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Question Chapter 6 page 230 SkinsDemo

The skins demo project is not working for me. I cannot debut until I am certain what I should have done. I apologize, since no one else posted about this I am certain the problem is me. Never the less, clarification is what I need.
From the text "Try It Out #4"
~~~~~
Create a new Web Form in the Demos folder and call it SkinsDemo.aspx. Make sure you base it on the exported template you created earlier...
~~~~~

The only thing I can reference about an exported template is the BasePage template. I assume that we do not want a web form and we do want a copy of the BasePage template file. However, when I look back at page 212 #9 is not clear if you select the template file or not before renaming it TestPage.aspx.

So anyway, I build the SkinsDemo file using the BasePage template file and I get an error:


Error 1 Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl). C:\Users\Michael\Documents\Visual Studio 2008\WebSites\BegASPNET\Site\demos\SkinsDemo.aspx. cs 14 33 C:\...\Site\
That line happens to be:
public partial class SkinsDemo

Changing that line to:
public partial class _Default : BasePage

Returns an error about the wrong file being referenced

Changing that line to match default.aspx:
public partial class _Default : BasePage

Results back to the first error about inheritance. The demos/SkinsDemo/aspx file top line reads: Inherits="SkinsDemo"

I am more than a bit lost as to what I have done wrong. I hope this is not confusing, I have been at this a while.

Could it be my .net version? Here is the browser output, last line reads .net 2.0.

Server Error in '/Site' Application.
--------------------------------------------------------------------------------

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: ASPNET: Make sure that the class defined in this code file matches the 'inherits' attribute, and that it extends the correct base class (e.g. Page or UserControl).

Source Error:



Line 12: using System.Xml.Linq;
Line 13:
Line 14: public partial class SkinsDemo
Line 15: {
Line 16: protected void Page_Load(object sender, EventArgs e)


Source File: c:\Users\Michael\Documents\Visual Studio 2008\WebSites\BegASPNET\Site\demos\SkinsDemo.aspx. cs Line: 14



Show Detailed Compiler Output:


c:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE> "C:\Windows\Microsoft.NET\Framework\v3.5\csc.e xe" /t:library /utf8output /R:"C:\Windows\assembly\GAC_MSIL\System.Configurati on\2.0.0.0__b03f5f7f11d50a3a\System.Configuration. dll" /R:"C:\Windows\assembly\GAC_MSIL\System.WorkflowSer vices\3.5.0.0__31bf3856ad364e35\System.WorkflowSer vices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Service s\2.0.0.0__b03f5f7f11d50a3a\System.Web.Services.dl l" /R:"C:\Windows\assembly\GAC_32\System.EnterpriseSer vices\2.0.0.0__b03f5f7f11d50a3a\System.EnterpriseS ervices.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceMode l\3.0.0.0__b77a5c561934e089\System.ServiceModel.dl l" /R:"C:\Windows\assembly\GAC_32\System.Data\2.0.0.0_ _b77a5c561934e089\System.Data.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3. 5.0.0__b77a5c561934e089\System.Xml.Linq.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.ServiceMode l.Web\3.5.0.0__31bf3856ad364e35\System.ServiceMode l.Web.dll" /R:"C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b7 7a5c561934e089\System.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0 .0.0__b03f5f7f11d50a3a\System.Drawing.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Mobile\ 2.0.0.0__b03f5f7f11d50a3a\System.Web.Mobile.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Web.Extensi ons\3.5.0.0__31bf3856ad364e35\System.Web.Extension s.dll" /R:"C:\Windows\Microsoft.NET\Framework\v2.0.50727\m scorlib.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Data.DataSe tExtensions\3.5.0.0__b77a5c561934e089\System.Data. DataSetExtensions.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.IdentityMod el\3.0.0.0__b77a5c561934e089\System.IdentityModel. dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0 __b77a5c561934e089\System.Xml.dll" /R:"C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0. 0__b77a5c561934e089\System.Core.dll" /R:"C:\Windows\assembly\GAC_32\System.Web\2.0.0.0__ b03f5f7f11d50a3a\System.Web.dll" /R:"C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_8y-fvvgv.dll" /R:"C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Code.je0ckjv5.dll " /R:"C:\Windows\assembly\GAC_MSIL\System.Runtime.Ser ialization\3.0.0.0__b77a5c561934e089\System.Runtim e.Serialization.dll" /out:"C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.dll" /debug- /optimize+ /win32res:"C:\Users\Michael\AppData\Local\Temp\Temp orary ASP.NET Files\site\c591442b\3de6cbb7\dp8fnl4s.res" /w:4 /nowarn:1659;1699;1701 /warnaserror- "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.10.c s" "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.13.c s" "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.12.c s" "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.14.c s" "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.3.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.2.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.1.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.0.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.7.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.6.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.5.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.4.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.9.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.8.cs " "C:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.11.c s"


Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.4926
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

c:\Users\Michael\Documents\Visual Studio 2008\WebSites\BegASPNET\Site\demos\SkinsDemo.aspx. cs(912305,33): error CS0115: 'ASP.demos_skinsdemo_aspx.FrameworkInitialize()': no suitable method found to override
c:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.10.c s(298,29): error CS0115: 'ASP.demos_skinsdemo_aspx.GetTypeHashCode()': no suitable method found to override
c:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.10.c s(303,30): error CS0115: 'ASP.demos_skinsdemo_aspx.ProcessRequest(System.We b.HttpContext)': no suitable method found to override
c:\Users\Michael\AppData\Local\Temp\Temporary ASP.NET Files\site\c591442b\3de6cbb7\App_Web_dp8fnl4s.10.c s(133,18): error CS0535: 'ASP.demos_skinsdemo_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable'
c:\Windows\assembly\GAC_32\System.Web\2.0.0.0__b03 f5f7f11d50a3a\System.Web.dll: (Location of symbol related to previous error)






--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4927; ASP.NET Version:2.0.50727.4927
 
Old January 29th, 2010, 10:40 PM
Registered User
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Addendum

I should have noted: Windows 7 Professional
Visual Studio 2008 Professional SP1
Internet Explorer 8

Contents of %systemroot%\Windows\Microsoft.NET
v1.03705
v1.14322
v2.050727
v3.0
v3.5

In the Turn Windows Features on or off dialog box

Microsoft .NET Framework 3.5.1 - the box is blue because these two options are not checked:
Windows Communication Foundation HTTP Activation
Windows Communication Foundation Non-HTTP Activation
 
Old January 29th, 2010, 11:48 PM
Registered User
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Disregard, the solution was change:

public partial class SkinsDemo

To:

public partial class SkinsDemo : BasePage

I thought basing the form on the BasePage Template wrote this line.
 
Old January 30th, 2010, 05:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
I thought basing the form on the BasePage Template wrote this line.
Yes, it should. Looks like your template is not OK. You may want to consider recreating it. Here's a run-down of what you need to do:

1. Add a new Web Form to the site using the Add New Item dialog
2. Make any changes you want to appear in new web forms
3. Replace the class placeholders and change System.Web,.UI.Page to BasePage
4. Choose File | Export Template
5. Delete the web form you created in step 1 from the site
6. To base a new page on your template, choose Add New Item and choose your template

The new Web Form based on the template should now have the code you added or modified in steps 2 and 3.

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 30th, 2010, 02:21 PM
Registered User
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for reading all that. It was a great learning oppotunity for me as well.
 
Old January 31st, 2010, 05:34 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

But is it working now? Did you manage to fix the Web Form template?

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 31st, 2010, 03:30 PM
Registered User
 
Join Date: Jan 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you Imar,

Yes, I did get that fixed just a while ago. Don't worry, I promise to have other questions to provide a diversion from your writing in the very near future.





Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 2 - page 41 problem creating the page.. jorjiana BOOK: Beginning Oracle Application Express ISBN: 9780470388372 2 August 22nd, 2009 04:25 AM
Possible typo on page 230 WebDNA BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 0 October 15th, 2008 11:12 AM
Chapter 5 Page 151 angelojr BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 June 12th, 2007 08:15 AM
Chapter 4 - page 170 stzd8 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 November 5th, 2006 12:04 AM





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