Wrox Programmer Forums
|
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
 
Old August 16th, 2011, 11:46 AM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default Try it Out Chapter 15 pg 546

Hi,

I get the following error when compling. Please help. Thanks.

Error:
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: CS1061: 'ASP.management_genres_aspx' does not contain a definition for 'GridView1_SelectedIndexChanged' and no extension method 'GridView1_SelectedIndexChanged' accepting a first argument of type 'ASP.management_genres_aspx' could be found (are you missing a using directive or an assembly reference?)

Source Error:

Line 4: </asp:Content>
Line 5: <asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
Line 6: <asp:GridView ID="GridView1" runat="server" AllowPaging="True"
Line 7: AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id"
Line 8: DataSourceID="SqlDataSource1"


Source File: e:\BegASPNET\Site\Management\Genres.aspx Line: 6


Code
Code:
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
    AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="Id" 
    DataSourceID="SqlDataSource1" 
    EmptyDataText="There are no data records to display." CellPadding="4" 
        ForeColor="#333333" GridLines="None" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
        onrowdatabound="GridView1_RowDataBound">
 
Old August 16th, 2011, 12:37 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

And is the error message correct? Do you see the missing method define in the file's Code Behind? If not, remove the following:

onselectedindexchanged="GridView1_SelectedIndexCha nged"

You may have accidentally set up this handler, then undid your changes in Code Behind (or closed the file without saving it), accidentally leaving this in the markup.

Cheers.

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!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 15 pg. 533 walbalooshi BOOK: Beginning ASP.NET 4 : in C# and VB 4 August 11th, 2010 02:13 PM
Chapter 15 Try Out Applying Styes Pg 533 lstew452 BOOK: Beginning ASP.NET 4 : in C# and VB 1 July 3rd, 2010 08:35 AM
Chap 15 pg 532 tomche BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 10 April 2nd, 2010 03:37 PM
listing 15-15 pg(568) DyerOppenheimer BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 February 13th, 2008 01:41 PM
Chapter 15 - Outlook Pg 448-449 MAB2005 BOOK: Access 2003 VBA Programmer's Reference 0 July 14th, 2005 07:56 AM





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