Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 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 August 18th, 2011, 09:55 AM
Authorized User
Points: 45, Level: 1
Points: 45, Level: 1 Points: 45, Level: 1 Points: 45, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default Chapter 17 custom error page problem..

Hi,
I just started chap 17 and I ran into some weird page when I test the 404 error handling, where I enter an unknown page address and it should send me to Errors/Error400.aspx .
here is the "yellow screen of death" I get:
Code:
http://localhost:59261/Site/Errors/Error404.aspx?aspxerrorpath=/Site/DefaultTest.aspx
Code:
Server Error in '/Site' Application.

Runtime Error

Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed. 

Details: To enable the details of this specific error message to be viewable on the local server machine, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "RemoteOnly". To enable the details to be viewable on remote machines, please set "mode" to "Off".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly"/>
    </system.web>
</configuration>

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="On" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>
here is my web.config:
Code:
<?xml version="1.0"?>
<!-- 
    Note: As an alternative to hand editing this file you can use the 
    web admin tool to configure settings for your application. Use
    the Website->Asp.Net Configuration option in Visual Studio.
    A full list of settings and comments can be found in 
    machine.config.comments usually located in 
    \Windows\Microsoft.Net\Framework\v2.x\Config 
-->
<configuration>
  <appSettings/>
  <connectionStrings>
    <add name="PlanetWroxConnectionString1" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\PlanetWrox.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
      <profile>
          <properties>
              <add name="FirstName" />
              <add name="LastName" />
              <add name="DateOfBirth" type="System.DateTime" />
              <add name="Bio" />
              <add name="FavoriteGenres" type="System.Collections.Generic.List`1[System.Int32]" />
          </properties>
      </profile>
    <!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
    <roleManager enabled="true" />
    <compilation debug="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Web.DynamicData, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.ComponentModel.DataAnnotations, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Data, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        <add assembly="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
    <!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
      <membership>
          <providers>
              <clear/>
              <add name="AspNetSqlMembershipProvider"
                   type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"
                   connectionStringName="LocalSqlServer"
                   enablePasswordRetrieval="false"
                   enablePasswordReset="true"
                   requiresQuestionAndAnswer="false"
                   applicationName="/"
                   requiresUniqueEmail="true"
                   passwordFormat="Hashed"
                   maxInvalidPasswordAttempts="5"
                   minRequiredPasswordLength="6"
                   minRequiredNonalphanumericCharacters="0"
                   passwordAttemptWindow="10"
                   passwordStrengthRegularExpression=""/>
          </providers>
      </membership>
      
      <authentication mode="Forms">
          <forms timeout="43200" />
      </authentication>
    <!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.
     -->

      <customErrors mode="On" defaultRedirect="~/Errors/Error500.aspx">
          <error statusCode="404" redirect="~/Errors/Error404.aspx"/>
          <error statusCode="500" redirect="~/Errors/Error500.aspx"/>
      </customErrors>
        
    <pages theme="Monochrome" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID">
      <controls>
        <add tagPrefix="Wrox" tagName="Banner" src="~/Controls/Banner.ascx"/>
      </controls>
    </pages>
  </system.web>
  <!-- 
  The system.webServer section is required for running ASP.NET AJAX under Internet
  Information Services 7.0.  It is not necessary for previous version of IIS.
  -->
  <system.net>
    <mailSettings>
      <smtp deliveryMethod="Network" from="Planet Wrox System &lt;******@******.Com&gt;">
        <network host="smtp.mail.*****.com" userName="******" password="*******"/>
      </smtp>
    </mailSettings>
  </system.net>
  <location path="Management">
      <system.web>
          <authorization>
              <allow roles="Managers"/>
              <deny users="*"/>
          </authorization>
      </system.web>
  </location>
  <location path="MyProfile.aspx">
      <system.web>
          <authorization>
              <deny users="?"/>
          </authorization>
      </system.web>
  </location>
  <location path="ManagePhotoAlbum.aspx">
      <system.web>
          <authorization>
              <deny users="?"/>
          </authorization>
      </system.web>
  </location>
  <location path="NewPhotoAlbum.aspx">
      <system.web>
          <authorization>
              <deny users="?"/>
          </authorization>
      </system.web>
  </location>
</configuration>
Reply With Quote
  #2 (permalink)  
Old August 19th, 2011, 09:18 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It seems that your error handling page is not working properly. You'll have to turn customErrors to Off in order to see why it's not working. Use the generated error URL you posted to test the Error404 page.
__________________
-Peter
compiledthoughts.com
twitter/peterlanoie
Reply With Quote
  #3 (permalink)  
Old August 19th, 2011, 09:34 AM
Imar's Avatar
Wrox Author
Points: 72,035, Level: 100
Points: 72,035, Level: 100 Points: 72,035, Level: 100 Points: 72,035, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,079
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Maybe you haven't set the page's Title and the check in the BaseBase for empty titles kicks in? Peter's suggestion would indeed help you find the real cause of the error.

Peter: good to see you're back.... ;-)

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
  #4 (permalink)  
Old August 19th, 2011, 10:17 AM
Authorized User
Points: 45, Level: 1
Points: 45, Level: 1 Points: 45, Level: 1 Points: 45, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2011
Posts: 11
Thanks: 2
Thanked 0 Times in 0 Posts
Default

I found the problem, it was a minor syntax error in page Error404.aspx
thanks anyway.
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
Chapter 17 Page 609: $safeitemname$ issue? AlexGrab BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 December 31st, 2010 06:06 AM
Chapter 17 Page 608 Try It out - Debugging your application ceboc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 November 24th, 2009 12:46 PM
DataGrid Updates BLANK PAGE (Chapter 17) happyhorseygal BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 April 8th, 2004 01:11 PM
data grid in chapter 17, page 708 gcpeters BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 1 January 16th, 2004 01:48 AM



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


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