Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 January 14th, 2009, 12:28 AM
Authorized User
 
Join Date: Dec 2008
Posts: 13
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter11

Hi,
All, have anyone complited the Chapter 11 TIO(Using profile In WroxUnited)?Because while
running the WroxUnited website of the chapter11 folder I am getting NULL reference exception.
The exception is thrown from the file fanclub.aspx.cs and.The exception is shown for the following line
((TextBox)FCLoginView.FindControl("txtName")).Text = Profile.Name;
The code is as follows:
private void DisplayProfileProperties()
{
TextBox NameBox = (TextBox)FCLoginView.FindControl("txtName");


if (NameBox != null )
{
((TextBox)FCLoginView.FindControl("txtName")).Text = Profile.Name;
((TextBox)FCLoginView.FindControl("txtAddress")).T ext = Profile.Address;
((TextBox)FCLoginView.FindControl("txtCity")).Text = Profile.City;
((TextBox)FCLoginView.FindControl("txtCounty")).Te xt = Profile.County;
((TextBox)FCLoginView.FindControl("txtPostCode")). Text = Profile.PostCode;
((TextBox)FCLoginView.FindControl("txtCountry")).T ext = Profile.Country;
((CheckBox)FCLoginView.FindControl("chkMailing")). Checked = Profile.Mailings;
((TextBox)FCLoginView.FindControl("txtEmail")).Tex t = Profile.Email;
((TextBox)FCLoginView.FindControl("txtAlias")).Tex t = Profile.MemberName;
}

}


So again I am seeking help regarding this problem..
Thanx in advance.
Regards,
Subhasis
 
Old January 18th, 2009, 04:36 PM
Authorized User
 
Join Date: Dec 2008
Posts: 56
Thanks: 1
Thanked 1 Time in 1 Post
Send a message via MSN to fh84
Default

this the code i have for chapter 11. it works except the drop down menu.

using System;
using System.Web;
using System.Web.UI.WebControls;

partial class FanClub : System.Web.UI.Page
{
private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
DisplayProfileProperties();
}
protected void btnCancelChanges_Click(object sender, System.EventArgs e)
{
DisplayProfileProperties();
}
protected void btnSaveChanges_Click(object sender, System.EventArgs e)
{
Profile.Theme = ((DropDownList)FCLoginview.FindControl("ThemeList" )).SelectedValue;
Profile.Name = ((TextBox)FCLoginview.FindControl("txtName")).Text ;
Profile.Address = ((TextBox)FCLoginview.FindControl("txtAddress")).T ext;
Profile.City = ((TextBox)FCLoginview.FindControl("txtCity")).Text ;
Profile.County = ((TextBox)FCLoginview.FindControl("txtCounty")).Te xt;
Profile.PostCode = ((TextBox)FCLoginview.FindControl("txtPostCode")). Text;
Profile.Country = ((TextBox)FCLoginview.FindControl("txtCountry")).T ext;
Profile.Mailings = ((CheckBox)FCLoginview.FindControl("chkMailing")). Checked;
Profile.Email = ((TextBox)FCLoginview.FindControl("txtEmail")).Tex t;
Profile.MemberName = ((TextBox)FCLoginview.FindControl("txtAlias")).Tex t;
Server.Transfer(SiteMap.CurrentNode.Url);
}
protected void FCLoginview_ViewChanged(object sender, System.EventArgs e)
{
DisplayProfileProperties();
}
private void DisplayProfileProperties()
{
TextBox NameBox = (TextBox)FCLoginview.FindControl("txtName");
if (NameBox != null)
{
((DropDownList)FCLoginview.FindControl("ThemeList" )).SelectedValue = Profile.Theme;
((TextBox)FCLoginview.FindControl("txtName")).Text = Profile.Name;
((TextBox)FCLoginview.FindControl("txtAddress")).T ext = Profile.Address;
((TextBox)FCLoginview.FindControl("txtCity")).Text = Profile.City;
((TextBox)FCLoginview.FindControl("txtCounty")).Te xt = Profile.County;
((TextBox)FCLoginview.FindControl("txtPostCode")). Text = Profile.PostCode;
((TextBox)FCLoginview.FindControl("txtCountry")).T ext = Profile.Country;
((CheckBox)FCLoginview.FindControl("chkMailing")). Checked = Profile.Mailings;
((TextBox)FCLoginview.FindControl("txtEmail")).Tex t = Profile.Email;
((TextBox)FCLoginview.FindControl("txtAlias")).Tex t = Profile.MemberName;
}
}

}


by the way, when you pick any value from the drop down menu, does it change the backgroud?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter11 page 400 asplundo BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 February 18th, 2008 09:29 AM
error in chapter11 postcard.php GOUR CHANDRA PAUL BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 December 7th, 2005 07:30 PM
chapter11 login webshark BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 16 March 23rd, 2004 06:42 PM





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