Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB 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
  #1 (permalink)  
Old August 28th, 2013, 02:58 PM
bpl bpl is offline
Authorized User
Points: 86, Level: 1
Points: 86, Level: 1 Points: 86, Level: 1 Points: 86, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Default calling function from Eval method

In chapter 14 we have plenty examples how to use Eval with simple property name, for example: <asp:Label ID="DescriptionLabel" runat="server" Text='<%#Eval("Description") %>' />
I need to display Phone Number in my DataObject; as Phone Number can be null, I created function
Function
FormatPhone(ByVal phone AsObject) AsString, which using phone as parameter. Is it possible to call this function with parameter from Eval method instead of property name to display Phone number as Label Text? How we can pass argument to the function from Eval?
  #2 (permalink)  
Old August 28th, 2013, 03:01 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Take a look at step 10 and later of the exercise on page 456 that shows you how to write the GetBooleanText method.

Hope this helps,

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!
  #3 (permalink)  
Old August 28th, 2013, 03:27 PM
bpl bpl is offline
Authorized User
Points: 86, Level: 1
Points: 86, Level: 1 Points: 86, Level: 1 Points: 86, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2009
Posts: 21
Thanks: 0
Thanked 1 Time in 1 Post
Default

Great!!! I did not pay attention on this very valuable example in "Try It Out" with calling GetBooleanText function with Authorized field as argument.
Example is very clear and simple. Thank you again for your very fast and great help!!!!!!!!!!!!!!!!!!! Your book is a bestseller!!!!!!!
The Following User Says Thank You to bpl For This Useful Post:
Imar (August 28th, 2013)


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error when calling Flush method. josephocena Pro Visual Basic 2005 0 December 2nd, 2009 04:53 AM
Calling a btn_click method without clicking it dhirajDac VB.NET 1 April 18th, 2008 08:24 AM
Calling a btn_click method dhirajDac ASP.NET 2.0 Professional 2 April 18th, 2008 07:52 AM
Calling a function on every method call Takashi321 General .NET 1 September 21st, 2007 09:33 AM
EVAL becomes failed, with IIF and Replace Function AbrarNazeer ASP.NET 2.0 Professional 0 July 6th, 2006 06:53 AM





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