Wrox Programmer Forums
|
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 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 8th, 2010, 01:43 PM
Authorized User
 
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 14 - Try It Out p. 491

Hello,

I'm having two problems with this Try It Out which is perplexing since the coding is so simple.

My first problem comes by entering the code in step 3. If I run the page with this code I get an error "Declaration expected" after line 1 of the code.
Code:
VB.NET
Imports System.Data

Partial Class Management_Reviews
    Inherits System.Web.UI.Page
    Protected Function GetBooleanText(ByVal booleanValue As Object) As String
        Dim authorized As Boolean = CType(booleanValue, Boolean)
        If authorized Then
            Return "Yes"
        Else
            Return "No"
        End If
    End Function

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
        Select Case e.Row.RowType
            Case DataControlRowType.DataRow
                Dim myRowView As DataRowView = CType(e.Row.DataItem, DataRowView)
                If Not Convert.ToBoolean(myRowView("Authorized")) Then
                    e.Row.CssClass = "HighContrast"
                End If
        End Select
    End Sub
End Class
If I try running the page without the code from step 3, I get an error "Type 'DataRowView' is not defined."

Jason
 
Old August 8th, 2010, 01:59 PM
Authorized User
 
Join Date: Jun 2010
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I figured out my error. I was not supposed to enter the "VB.NET." I have placed the dunce cap on my head and will sit in the corner for a few minutes.
 
Old August 9th, 2010, 02:35 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hahaha. it's OK to come out of the corner again now.... ;-)

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 14: Pages 491-492: Part of row doesn't show the black background gfmann BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 14 March 3rd, 2010 10:42 AM
Chapter 14 page 491 Will BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 April 25th, 2009 04:52 AM
Chapter 14 example pkumar@ech BOOK: Professional Jakarta Struts 0 November 15th, 2006 09:10 AM
Chapter 14 JonG BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 21st, 2006 10:04 PM
Chapter 14 Mike Smith BOOK: Professional C#, 2nd and 3rd Editions 2 January 4th, 2004 05:13 PM





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