Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Professional ASP.NET MVC 2
|
BOOK: Professional ASP.NET MVC 2
This is the forum to discuss the Wrox book Professional ASP.NET MVC 2 by Jon Galloway, Scott Hanselman, Phil Haack, Scott Guthrie, Rob Conery; ISBN: Professional ASP.NET MVC 2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional ASP.NET MVC 2 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 December 7th, 2010, 07:34 PM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default TryUpdateModel(object) not calling 'String.Trim()' on values!

Hi to all.
I've just bought this book and i'm finishing chapter 01.
I just noticed a thing:

When I create and/or edit a Dinner, all the values are stored on the DB filled with blankspaces at the end.
This is crashing my App, because on the method "IsHostedBy(String user)" it never returns true, because my login is "login" and it's stored "login "

So, How to avoid this?
 
Old December 7th, 2010, 08:55 PM
Friend of Wrox
 
Join Date: Oct 2010
Posts: 106
Thanks: 1
Thanked 17 Times in 17 Posts
Default

See if the column in the table is nchar versus nvarchar.
 
Old December 8th, 2010, 10:18 AM
Registered User
 
Join Date: Dec 2010
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks a lot, the problem was this =D





Similar Threads
Thread Thread Starter Forum Replies Last Post
TryUpdateModel no longer saving edits ajameson BOOK: Professional ASP.NET MVC 2 15 January 25th, 2011 11:34 AM
trim a string to the first character jd_erd Access 2 May 6th, 2007 11:01 PM
Trim a string in VBA lryckman Access VBA 2 January 19th, 2007 08:39 AM
javascript string Trim() frunction kokuthanda VBScript 0 October 12th, 2006 02:45 AM
String.trim() mrfox BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 1 January 8th, 2006 12:23 AM





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