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 16th, 2010, 09:03 PM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default Ch 14 Page 485 Try-It-Out problem

I carefully followed the instructions from page 485 to page 488
However, when I run the page I get the error message below:

Any clues anyone?
Thanks
Ken

Note: The code for my page "Events.aspx" is at the bottom of this post.



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

Could not load type 'PlanetWroxDataContent'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Could not load type 'PlanetWroxDataContent'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Could not load type 'PlanetWroxDataContent'.]
System.Web.Compilation.BuildManager.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase) +8830689
System.Web.UI.WebControls.LinqDataSourceView.get_C ontextType() +93

[InvalidOperationException: Could not find the type specified in the ContextTypeName property of LinqDataSource 'LinqDataSource1'.]
System.Web.UI.WebControls.LinqDataSourceView.get_C ontextType() +209
System.Web.UI.WebControls.LinqDataSourceView.Creat eContextAndTable(DataSourceOperation operation) +680
System.Web.UI.WebControls.LinqDataSourceView.Creat eContextAndTableForSelect() +91
System.Web.UI.WebControls.LinqDataSourceView.Execu teSelect(DataSourceSelectArguments arguments) +383
System.Web.UI.DataSourceView.Select(DataSourceSele ctArguments arguments, DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.Perform Select() +142
System.Web.UI.WebControls.BaseDataBoundControl.Dat aBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
System.Web.UI.WebControls.BaseDataBoundControl.Ens ureDataBound() +82
System.Web.UI.WebControls.CompositeDataBoundContro l.CreateChildControls() +72
System.Web.UI.Control.EnsureChildControls() +87
System.Web.UI.Control.PreRenderRecursiveInternal() +44
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

Code for Events.aspx
Code:
 <%@ Page Title="Demo - Events" Language="C#" MasterPageFile="~/MasterPages/MasterPage.master" AutoEventWireup="true" CodeFile="Events.aspx.cs" Inherits="Demos_Events" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
  <table>
  <tr>
  <td>
  <h1>No Postback</h1><asp:Label ID="lblNoPostback" runat="server" ></asp:Label>
  </td>
  <td>
  <h1>Postback</h1><asp:Label ID="lblPostback" runat="server" ></asp:Label>
  </td>
  </tr>
  
  </table>
  <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" DataKeyNames="Id" AllowSorting="True" DataSourceID="LinqDataSource1" 
    ondatabinding="GridView1_DataBinding" ondatabound="GridView1_DataBound" onrowcreated="GridView1_RowCreated" onrowdatabound="GridView1_RowDataBound" 
    onsorted="GridView1_Sorted" onsorting="GridView1_Sorting">
    <Columns>
      <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="false" ReadOnly="true" SortExpression="Id" />
      <asp:BoundField DataField="Name" HeaderText="name" SortExpression="Name" />
      <asp:BoundField DataField="SortOrder" HeaderText="SortOrder" SortExpression="SortOrder" />
      
      
    </Columns>
  </asp:GridView>
  <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="Button" />
  <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="PlanetWroxDataContent" TableName="Genres" 
    oncontextcreating="LinqDataSource1_ContextCreating" onselecting="LinqDataSource1_Selecting" >
  </asp:LinqDataSource>
</asp:Content>
 
Old January 17th, 2010, 05:20 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Ken,

You may want to check your speling: it's PlanetWroxDataContext with an x and not PlanetWroxDataContent.

Did you reolve the other issue you e-mailed me about?

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 17th, 2010, 07:08 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default

Hi Imar,
I changed the spelling but I still get the same error message.

I skipped the LINQ chapter because I read somewhere that MSFT may be planning to deprecate LINQ in favour of ADO.NET. Furthermore, I plan to try my best to make exclusive use of the SqlDataSource.

Could it be that by skipping the LINQ chapter, that I failed to create something that is needed in Ch 14?

Page 486
Also, I had problems with the instruction "Bind the LinqDataSource control to the Genres table" (top of page 486). Of course I put it in the code but the LinqDataSource control Wizard didn't have the Genres table in it.


My earlier post - Page 344 problem
I have posted this problem three times but it still does not appear in the Forum.
1. My first post was two days ago. The post was there for almost a day. There were 0 replies and more than 30 views. Then it just disappeared. (Just before my post disappeared I had edited it to include the "code" tags.)

2. Following your advice, I posted the problem a second time. This was about 30 minutes before the post that started this thread. I waited for a while but this second post did not appear. Then I saw that THIS post had appeared. So...

3. I posted the problem a third time. And we are still waiting...

There must be a trace in the DB log for this Forum but I don't know who to ask about it.

Thanks for a great book.
Ken
 
Old January 17th, 2010, 07:23 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yes, you need to follow the LINQ chapter in order to follow along with later chapters. You'll create the model (and the DataContext) that you use in later chapters.

You can get a copy of the source for the LINQ chapter from the downloads that come with the book.

Try reporting your forum problem here: http://p2p.wrox.com/p2p-wrox-com-feedback-56/ I get e-mail notifications when something has been posted, but I haven't seen a thing. In the mean-time, you can send me the full post text by e-mail and I'll take a look.

Maybe your post contains bad words, or words that look like bad words so it gets filtered? Just a guess....

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!
The Following User Says Thank You to Imar For This Useful Post:
ken evans (January 17th, 2010)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Toolbar problem in Horton VC++ 2008 Ch. 14 tedkurtz Visual C++ 1 November 9th, 2009 04:46 PM
Ch.14 Creating Windows Form User Controls problem SAIFI BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 1 September 29th, 2008 05:51 AM
Ch 14 AdNew.asp example - Acess permission problem pycockd BOOK: Beginning ASP 3.0 4 February 7th, 2006 06:36 PM
Ch. 13/14 creating own custom controls...problem.. Chimlim BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 2 August 10th, 2005 04:21 AM
CH. 14 cart.php code problem shawnrberg BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 21st, 2004 05:44 PM





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