Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4.5.1 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4.5.1: in C# and VB by Imar Spaanjaars; ISBN: 978-1-118-84677-3
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4.5.1 : 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 July 5th, 2015, 09:36 PM
Authorized User
 
Join Date: Jun 2015
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 4 - Page 104

In step 8 of page 104, I used C# and is supposed to add:
"Result.Text = "Your name is " + YourName.Text;

But every time I key up to "Result." it kick me into this: "DataSourceSelectResultProcessingOptions."

I tried following through with this "DataSourceSelectResultProcessingOptions.Text = "Your name is " + YourName.Text;"

Did I do something wrong in the Properties Grid? I went all over again in steps 1 to 7 a few times. Right now I "stuck".
 
Old July 5th, 2015, 09:57 PM
Authorized User
 
Join Date: Jun 2015
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I thought I found the error in my Properties Grid. But on Ctrl+F5, the following error message occured:

Server Error in '/' Application.

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0117: 'System.Web.UI.WebControls.DataSourceSelectResultP rocessingOptions' does not contain a definition for 'Text'

Source Error:

Line 14: protected void SubmitButton_Click(object sender, EventArgs e)
Line 15: {
Line 16: DataSourceSelectResultProcessingOptions.Text = "Your name is" + YourName.Text;
Line 17: }
Line 18: protected void SubmitButton_Click1(object sender, EventArgs e)


Source File: c:\BegASPNETCS\Site\Demo\ControlsDemo.aspx.cs Line: 16
 
Old July 6th, 2015, 02:32 AM
Authorized User
 
Join Date: Jun 2015
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I will try and see if I got the terminologies correct:

In step 5 of page 104, Figure 4-2 showed "Text" (highlighted) and "Button". When you use the term "Set the control's Text property", you referring to "Button" on displayed in Figure 4-2?

In step 6, this is what I did:
- right click "text box" in Design mode, then click "properties" in the dialogue box. Under Properties, "text" highlighted and there is a empty space next to it. I enter "YourName" in that space.

In step 7, this is what I did:
- right click "label" in Design mode, then click "properties" in the dialogue box. Under Properties, "text" highlighted and there is a "Label" next to it. I manually deleted "Label" and keyed in "Result".

In step 8, this is what I did:
- double click button (which is now "Submit Information") and entered the following:

protected void SubmitButton_Click(object sender, EventArgs e)
{
Result.Text = "Your name is " + YourName.Text;
}

I click Cltrl+F5, it is still an error message.

So I am still stuck after the past few hours of repeated attempts.
 
Old July 6th, 2015, 02:37 AM
Authorized User
 
Join Date: Jun 2015
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It will be helpful if we can communicate the various steps with screen shots. ASP.Net seems alot more complex than Dreamweaver.
 
Old July 7th, 2015, 10:42 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Paul,

Looks like you're mixing up stuff and missed a few instructions:

Quote:
In step 5 of page 104, Figure 4-2 showed "Text" (highlighted) and "Button". When you use the term "Set the control's Text property", you referring to "Button" on displayed in Figure 4-2?
Yes, I am. In 4.2 it still shows Button but you need to change that to SubmitInformation. You then also need to change the control's ID. From the book: "and set its ID (which you’ll find all the way down at the bottom of the list wrapped in parentheses) to SubmitButton."

Quote:
In step 6, this is what I did:
- right click "text box" in Design mode, then click "properties" in the dialogue box. Under Properties, "text" highlighted and there is a empty space next to it. I enter "YourName" in that space.
Nope, you need to change the ID property, not the Text property. From the book: "Change the ID of the TextBox to YourName using the Properties Grid"
Quote:
In step 7, this is what I did:
- right click "label" in Design mode, then click "properties" in the dialogue box. Under Properties, "text" highlighted and there is a "Label" next to it. I manually deleted "Label" and keyed in "Result".
Nope. Step one is good (clear the default Text of "Label") but then you shouldn't assign Result to the Text property, but to the ID property. From the book: "Set its ID to Result."

Quote:
In step 8, this is what I did:
- double click button (which is now "Submit Information") and entered the following:

protected void SubmitButton_Click(object sender, EventArgs e)
{
Result.Text = "Your name is " + YourName.Text;
}

I click Cltrl+F5, it is still an error message.
This should work if the Label has an ID of Result and the TextBox an ID of YourName. You can check the Markup view to see if it all looks right.

Hope this helps,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Page 104 - Classes and Instances John S BOOK: Stephens' C# Programming with Visual Studio 2010 24-Hour Trainer 1 July 26th, 2013 11:13 PM
Page 104 kinvig BOOK: Professional ASP.NET MVC 2 0 September 13th, 2010 12:12 PM
Page 104 Nicholsen BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 0 November 27th, 2008 05:37 AM
confuse page 104 kencheung BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 August 16th, 2004 03:32 PM





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