Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 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
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old February 8th, 2010, 10:13 PM
Registered User
 
Join Date: Feb 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Question Validation before LoadObjectFromScreen()

Hi, Everyone

I tried the examples in Chapter 4, and added a text box called Phone number on my EditPage with the following business rules:
Phone number is required and must be digits.

So in the LoadObjectFromScreen method I added:
baseEo.PhoneNumber = Convert.ToInt32(txtPhoneNumber.Text);

But if there is blank in the text field, then there is a run time error on it "Input string was not in a correct format.". Should I add some validation or validation controls before that method, or there are some better solutions there

Cheers
Eagle
  #2 (permalink)  
Old February 25th, 2010, 11:24 AM
Wrox Author
 
Join Date: Jan 2009
Posts: 73
Thanks: 0
Thanked 7 Times in 7 Posts
Default

Hi Eagle,
Yes you should put a check in before this line of code to make sure that the phone number contains a number. You also might want to store the phone number as a string rather than a number just in case a user types in spaces or ( ) for area code.
Hope this helps,
Vince
 


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
Validation before LoadObjectFromScreen() luckyeagle BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 February 8th, 2010 10:11 PM
Standalone validation + web form validation morbo Struts 0 August 19th, 2008 04:02 AM
Validation using Validation Framework kalyangvd Struts 1 January 2nd, 2008 06:53 AM
validation abhishekdubey_997 ASP.NET 1.0 and 1.1 Basics 4 November 3rd, 2006 09:16 AM
Validation NiNe ASP.NET 1.x and 2.0 Application Design 1 July 5th, 2005 10:27 AM



All times are GMT -4. The time now is 04:25 AM.


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