|
|
 |
BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X  | This is the forum to discuss the Wrox book Professional Web Parts and Custom Controls with ASP.NET 2.0 by Peter Vogel; ISBN: 9780764578601 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional Web Parts and Custom Controls ASP.NET ISBN: 0-7645-7860-X section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of computer programmers 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 programmers’ questions, win occasional prizes given to our best members, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
|
 |
|
|
 |

September 3rd, 2006, 08:03 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Chapter 12
Chapter 12 is almost done, I'll be posting it shortly.
|

September 7th, 2006, 08:25 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
|
|
I've posted Chapter 12 at http://100days.net/wrox/
The customization and communication from that chapter aren't implemented yet. That's next. I'll update the code with it as soon as it's done.
|

September 9th, 2006, 05:47 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I'm trying to walk through chapter 12 and I'm on page 392 where it tells me to compile to see my control in my toolbox like figure 12.5.
I've built the project, there is a reference to it in test web project, but I still don't see it in the toolbox.
My code is below.
Is there something missing from the code?
Thanks in advance for any help!
czone
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace CaseStudyControlsCS
{
[ToolboxData("<{0}:CustomerInformation runat=server></{0}:CustomerInformation>")]
public class CustomerInformation : System.Web.UI.WebControls.WebParts.WebPart
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
if (this.DesignMode == true)
{
this.EnsureChildControls();
}
}
protected override void CreateChildControls()
{
System.Web.UI.WebControls.Style st = new System.Web.UI.WebControls.Style();
if (this.ControlStyleCreated == true)
{
st = this.ControlStyle;
}
else
{
st = new System.Web.UI.WebControls.Style();
}
System.Web.UI.WebControls.Label lblName = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblEmail = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblStreet = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblCity = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblStateProvince = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblCountry = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblNameLb = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblEmailLb = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblStreetLb = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblCityLb = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblStateProvinceLb = new System.Web.UI.WebControls.Label();
System.Web.UI.WebControls.Label lblCountryLb = new System.Web.UI.WebControls.Label();
lblName.ID = "lblName";
lblName.Attributes["DisplayType"] = "label";
lblEmail.ID = "lblEmail";
lblEmail.Attributes["DisplayType"] = "label";
lblStreet.ID = "lblStreet";
lblStreet.Attributes["DisplayType"] = "label";
lblCity.ID = "lblCity";
lblCity.Attributes["DisplayType"] = "label";
lblStateProvince.ID = "lblStateProv";
lblStateProvince.Attributes["DisplayType"] = "label";
lblCountry.ID = "lblCountry";
lblCountry.Attributes["DisplayType"] = "label";
lblNameLb.Text = "Name:";
lblNameLb.Attributes["DisplayType"] = "data";
lblEmailLb.Text = "Email:";
lblEmailLb.Attributes["DisplayType"] = "data";
lblStreetLb.Text = "Street:";
lblStreetLb.Attributes["DisplayType"] = "data";
lblCityLb.Text = "City:";
lblCityLb.Attributes["DisplayType"] = "data";
lblStateProvinceLb.Text = "State/Province:";
lblStateProvinceLb.Attributes["DisplayType"] = "data";
lblCountryLb.Text = "Country:";
lblCountryLb.Attributes["DisplayType"] = "data";
this.Controls.Clear();
this.Controls.Add(lblName);
this.Controls.Add(lblNameLb);
this.Controls.Add(lblEmail);
this.Controls.Add(lblEmailLb);
this.Controls.Add(lblStreet);
this.Controls.Add(lblStreetLb);
this.Controls.Add(lblCity);
this.Controls.Add(lblCityLb);
this.Controls.Add(lblStateProvince);
this.Controls.Add(lblStateProvinceLb);
this.Controls.Add(lblCountry);
this.Controls.Add(lblCountryLb);
this.ChildControlsCreated = true;
}
}
}
czone
|

September 10th, 2006, 05:20 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Forget my previous post, I was able to resolve the issue by manually selecting the DLL when adding an item to the tool box.
Thanks!
czone
|

September 10th, 2006, 05:25 PM
|
|
Registered User
|
|
Join Date: Aug 2006
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I do have a question related to page 421 - Displaying User Data on Postback.
The text is not clear as to where the code should go. I put it in the IPostBackDataHandler.LoadPostData method (see page 413) but I get errors telling me that the txtName & others are not recognized.
So where should the code on page 421 go? Is it a new method or should it be added to an existing method? If an existing method, which one?
I also get an error telling me that the public modifier is not balid for the IPostBackDataHandler.LoadPostData method. This is fixed by not putting a modifier on it but I don't think this is the best way to fix the error. How should this error be fixed?
Thanks,
Czone
czone
|

September 10th, 2006, 08:31 PM
|
|
Authorized User
|
|
Join Date: Jul 2006
Location: , , .
Posts: 14
Thanks: 0
Thanked 1 Time in 1 Post
|
|
Have you had a chance to download the newer version of Chapter 12's code, yet? Get it from here and take a look at it. Let's work from that codebase to get to your answers. The text leaves out a few crucial details but you'll see where those methods should be in the newer code. Let me know what your questions are after you look through it.
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
 |