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>