Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 1.1
This is the forum to discuss the Wrox book Beginning ASP.NET 1.1 with Visual C#.NET 2003 by Chris Ullman, John Kauffman, Chris Hart, Dave Sussman, Daniel Maharry; ISBN: 9780764557088
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 1.1 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 January 19th, 2005, 12:30 PM
Registered User
 
Join Date: Jan 2005
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to rbowie
Default chap 11 - day render error

Hi There

I've got a problem. Im new to asp.net and working my way thru the book, VB.net 2003.

Im in the section about cache. I've changed the second line of code, as instrcuted, from:

Sub EventCalendar_DayRender(sender As Object, e As DayRenderEventArgs)
    If Not cache("DateList")(e.day.date) is nothing then
        e.cell.style.add("font-weight", "bold")
        e.cell.style.add("font-size", "Larger")
        e.cell.style.add("border", "3 dotted darkred")
        e.cell.style.add("background", "#f0f0f0")
    else
        e.cell.style.add("font-weight", "Lighter")
        e.cell.style.add("color", "DimGray")
    end if
End Sub

To

    If Not cache("DateList")(e.day.date) is nothing then


Since doing this i get the error:

    Object variable or With block variable not set.


It only happens occasionaly.

Any Help would be great.

Thanks,
Robert.


 
Old January 19th, 2005, 03:27 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Are you sure that should be

If Not cache("DateList")(e.day.date) is nothing then

And not:

If Not cache("DateList") is nothing then

or

If Not e.day.date Is Nothing?

I haven't actually read the book, but I think it makes sense to either check the Cache (If Cache("DateList") or get the date from the DayRenderEventArgs passed to this event.

Can you post your entire code if this doesn't help?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Thoughts Of A Dying Atheist by Muse (Track 13 from the album: Absolution) What's This?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 11 codes from Design or Source tab? cJeffreywang BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 0 January 2nd, 2008 11:30 AM
html:text render the value when error comes in jsp srikanth_bsb Struts 0 February 20th, 2007 03:54 AM
Chap. 11 - Try It Out, Session Tracking with PHP Tachyon BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 5 June 17th, 2004 02:02 PM
problem in chap 11 joeore BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 January 30th, 2004 04:38 PM
error: Failed to render the page kimonkod Crystal Reports 3 July 2nd, 2003 12:09 PM





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