Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
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
 
Old December 6th, 2011, 06:18 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default Ch 17 Storing Basic User Data in the Profile - dateOfBirth Error!

Ch 17 Storing Basic User Data in the Profile

All going good again, but when I come to add the date to the date of birth text box, the validator says it is wrong? How come?

Code behind:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class UserProfile : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            FirstName.Text = Profile.FirstName;
            LastName.Text = Profile.LastName;
            DateOfBirth.Text = Profile.DateOfBirth.ToShortDateString();
            Bio.Text = Profile.Bio;
        }
    }
    protected void SaveButton_Click(object sender, EventArgs e)
    {
if (Page.IsValid)
        {
            Profile.FirstName = FirstName.Text;
            Profile.LastName = LastName.Text;
            Profile.DateOfBirth = DateTime.Parse(DateOfBirth.Text);
            Profile.Bio = Bio.Text;
        }
    }
}
 
Old December 6th, 2011, 06:22 PM
Authorized User
 
Join Date: Oct 2010
Posts: 71
Thanks: 12
Thanked 0 Times in 0 Posts
Default

Doesn't matter - I figured it out





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch 17 Creating a Profile... error! leeWozyWarren BOOK: Beginning ASP.NET 4 : in C# and VB 3 December 6th, 2011 06:25 PM
CH 17 - Assemblies equintana71 BOOK: Professional C# 2008 ISBN: 978-0-470-19137-8 1 May 17th, 2011 09:20 PM
error in ch 17 on running both fils no17 Beginning PHP 0 May 10th, 2008 02:15 AM
How to accept DateofBirth from user in C/ C++ lang myquery C++ Programming 1 October 25th, 2007 10:27 PM
IStateManager.TrackViewState() Ch 17 EdKroket BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 January 25th, 2007 07:10 AM





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