Wrox Programmer Forums
|
BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio
This is the forum to discuss the Wrox book ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solution by Vincent Varallo; ISBN: 9780470396865
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 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 April 3rd, 2009, 11:17 AM
Authorized User
 
Join Date: Mar 2009
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default Users.aspx chapter 4 will not run because...

Hello,

The Users.aspx page will not run because it's trying to sort on a bound column that does not exist.

Users.aspx code looks something like this (vb.net):

Code:
 
...
cgvUsers.AddBoundField("", "Actions", "")
cgvUsers.AddBoundField("DisplayText", "Name", "DisplayText")
cgvUsers.AddBoundField("WindowsAccountName", "Windows Account", "WindowsAccountName")
cgvUsers.AddBoundField("Email", "Email", "Email")
cgvUsers.AddBoundField("", "Active", "IsActive")
cgvUsers.DataBind()
...
The columns come from the ListClassName which is ENTUserAccountEOList (this is pretty cool)

Anyway, ENTUserAccountEOList is a list of ENTUserAccountEO objects. It's looking for a property called 'DisplayText" and I could not find that property. So to get around this issue I created a readonly property called DisplayText that returns the function GetDisplayText:

Code:
 
Public ReadOnly Property DisplayText() As String
Get
     Return GetDisplayText()
End Get
End Property
This does work and The page now renders, however not sure if this is the correct way.

Thanks,
-realkewl

Note:
I could not find ENTUserAccountEOList in chapter 4's source code...so you can just write it using the book

Last edited by realkewl; April 3rd, 2009 at 11:20 AM..
 
Old April 4th, 2009, 12:10 AM
Authorized User
 
Join Date: Apr 2009
Posts: 41
Thanks: 1
Thanked 2 Times in 2 Posts
Default

The DisplayText property is defined in ETBaseBO as a read-only property that calls the GetDisplayText() abstract method. It's up to the inheriting class to implement GetDisplayText(). See Page 50.

For ENTUserAccountEO's implementation, see page 66.

ENTUserAccountEOList is in the ENTUserAccountEO.cs file. The author puts the object and object list classes in the same file to reduce the total file count and make things easier to manage (page 66, as well).

Hope this helps :)

Tim
 
Old April 7th, 2009, 09:22 AM
Authorized User
 
Join Date: Mar 2009
Posts: 27
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Tim,

Thank you!! You are correct. I had a typo in my property name (can you believe that) it said DisplayTest instead of DisplayText. Thanks so much...

-realkewl
 
Old April 9th, 2009, 01:54 AM
Authorized User
 
Join Date: Apr 2009
Posts: 41
Thanks: 1
Thanked 2 Times in 2 Posts
Default

realkewl -

You're welcome. I know all about typos....I keep waiting for an IDE that will input what I meant to type, rather than what I actually typed. It would save me a lot of headaches :)

Tim





Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to run Chapter 2 Example tkachuk BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 6 August 2nd, 2009 11:37 PM
A caution for users at Chapter 5, Ex. 03 Prism BOOK: Ivor Horton's Beginning Visual C++ 2005 1 April 14th, 2008 02:32 AM
ModuleConfig Users and Authentication Chapter 5 seanmayhew BOOK: ASP.NET Website Programming Problem-Design-Solution 0 July 5th, 2004 10:49 AM





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