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 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 November 10th, 2009, 03:31 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default Ch14 Try It Out Pg. 506

Hi,

I'm working on this try it out and for some reason the title for the ViewDetails.aspx page is not being set programmatically and so my basepage template raises an error.

I have this code in the codebehind...
Code:
Partial Class ViewDetails
  Inherits BasePage

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    Dim reviewId As Integer = Convert.ToInt32(Request.QueryString.Get("ReviewId"))
    Dim myReview As Review

    Using db As New PlanetWroxDataContext()
      myReview = (From r In db.Reviews _
                  Where r.Id = reviewId _
                  Select r).Single()
      lblTitle.Text = myReview.Title
      lblSummary.Text = myReview.Summary
      lblBody.Text = myReview.Body

      'Set the page title programmatically
      Me.Title = myReview.Title
    End Using
  End Sub
End Class
Maybe I misspelled something and I'm not seeing it.

Update**
When I set the title to the ViewDetails.aspx in markup everything works fine. The title is changed to the proper one once the page loads. The error is being raised before the Page_Load event is triggered. Why is this happening?


Chuck

Last edited by eiviery; November 10th, 2009 at 03:47 PM..
Reply With Quote
  #2 (permalink)  
Old November 11th, 2009, 04:47 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
The error is being raised before the Page_Load event is triggered. Why is this happening?
Hard to tell why this is happening without seeing the actual error....

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
  #3 (permalink)  
Old November 11th, 2009, 01:37 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Hi,

I am receiving the error that we set up in the base page about the Title of the page being blank.
Reply With Quote
  #4 (permalink)  
Old November 11th, 2009, 01:49 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

Yeah, I see now. Sorry I missed that (a reference to the error was in your original post).

I think you're running into an old, annoying (and unfixed) bug:

https://connect.microsoft.com/Visual...305749#details

Setting the title to a non-empty value in markup before you assign it dynamically is indeed the work-around.

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:
eiviery (November 11th, 2009)
  #5 (permalink)  
Old November 11th, 2009, 01:58 PM
Authorized User
 
Join Date: Oct 2009
Posts: 22
Thanks: 7
Thanked 0 Times in 0 Posts
Default

Thanks Imar,

While I'm never excited about bugs, I'm relieved that it wasn't something I was doing wrong.

Offtopic: Did you get a chance to take a look at the error list I posted for my other issue?

Complie Issue

^^^^^
*Compile :)

By the way I tried to load the site from my flashdrive on a different desktop and I got the same error concerning the Picture class.

Thanks,


Chuck
Reply With Quote
  #6 (permalink)  
Old November 11th, 2009, 02:01 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Quote:
Did you get a chance to take a look at the error list I posted for my other issue?
I just did, three minutes ago.....
__________________
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
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
pgs. 506-512 "r" ? Rachel BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 3 January 2nd, 2009 05:02 AM
My VB Code for Ch14 PatFrank BOOK: Beginning ASP.NET 2.0 and Databases 8 April 17th, 2007 02:34 PM
Ch14 - timesheets with one row geoffers BOOK: Beginning VB.NET Databases 0 August 24th, 2005 08:48 AM



All times are GMT -4. The time now is 10:46 PM.


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