Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 7th, 2013, 11:54 PM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2009
Location: Connecticut, USA
Posts: 63
Thanks: 18
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Wilfredo Rosado
Question Parse Error

My program was working fine and after making some changes I get this error when I try to bring up the default.aspx page. all other pages come up fine. Does anybody have an idea as to why?

Fred



Code:
Parser Error 
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: 'iGrades._Default' is not allowed here because it does not extend class 'System.Web.UI.Page'.

Source Error: 


Line 1:  <%@ Page Title="iGrades - Home Page" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/iGrades.Master" CodeBehind="Default.aspx.vb" Inherits="iGrades._Default" %>
Line 2:  <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
Line 3:  </asp:Content>
 

Source File: /Default.aspx    Line: 1 


--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272
Default.aspx
Code:
<%@ Page Title="iGrades - Home Page" Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPages/iGrades.Master" CodeBehind="Default.aspx.vb" Inherits="iGrades._Default" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">
    <h2>
        Welcome to iGrades Web App.
    </h2>
    <h3>
        A Web Appplication designed to allow professors to automatically maintain their student's scores.
    </h3>        
    <h3>
        Coming Soon!
    </h3>
</asp:Content>
Default.aspx.designer.vb
Code:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated. 
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Partial Public Class _Default
End Class
Default.aspx.vb
Code:
Public Class _Default
  Inherits System.Web.UI.Page

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

  End Sub

End Class
Reply With Quote
  #2 (permalink)  
Old January 8th, 2013, 03:57 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Since this is not related to my book directly, try posting questions like this one in a general ASP.NET 4 category from this list: http://p2p.wrox.com/asp-net-4-539/

That said, your _Default designer class is missing the Inherits attribute that makes it inherit System.Web.UI.Page. Check out the differences between the last two files you posted.

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!
Reply With Quote
The Following User Says Thank You to Imar For This Useful Post:
Wilfredo Rosado (January 9th, 2013)
  #3 (permalink)  
Old January 9th, 2013, 01:28 AM
Authorized User
Points: 303, Level: 6
Points: 303, Level: 6 Points: 303, Level: 6 Points: 303, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2009
Location: Connecticut, USA
Posts: 63
Thanks: 18
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Wilfredo Rosado
Default

I looked at the last two programs I have listed as you said, and I'm not sure what to look for. I compared these default files with another program and they look almost similar. I posted this also in the general section of P2P...so hopefully someone there can help me.

Thanks for trying, much appreciated,
Fred
Reply With Quote
  #4 (permalink)  
Old January 9th, 2013, 06:11 AM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Oh, my bad. I thought that the designer file had to inherit Page explicitly as well but since it's a partial class, it doesn't have to.

It looks like iGrades._Default in the markup is not a valid type, which could indicate the (root) namespace of the project has changed. To find out what it needs to be, add a new Web Form to the project and look at the Inherits in markup up.

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!

Last edited by Imar; January 16th, 2013 at 07:27 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING ngchpg BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 16th, 2012 03:28 AM
Ch 4: Parse error: syntax error, unexpected T_SL hanizar77 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 June 23rd, 2008 09:17 PM
PHP Parse error: parse error, unexpected T_STRING geminient PHP How-To 4 August 18th, 2007 02:27 AM
Parse error: parse error, unexpected $end Ayodeji Adegbaju Pro PHP 3 January 12th, 2007 12:21 PM



All times are GMT -4. The time now is 05:37 AM.


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