Wrox Programmer Forums
|
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 October 14th, 2010, 01:03 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jarrettdd
Default Help with Chapter 4 Try it Out

Hello All,

My name is Darrell. I have a quick question. The code that was given to us in Chap 4 first Try it Out is not working the way the book explains. Everything is correct until I get to the View Source. The book stats that it should display this.

<div>
Your name <input name="YourName" type="text" id="YourName" />
<input type="submit" name="SubmitButton" value="Submit Information"
id="SubmitButton" />
<br />
<span id="Label1"></span>
</div>

before we input anything in the text box and click submit. This part is working fine. The next part isn't

It also states that after we enter our name in the text box and click submit we should get this in the View Source.

<div>
Your name <input name="YourName" type="text" value="Darrell"
id="YourName" />

<input type="submit" name="SubmitButton" value="Submit Information"
id="SubmitButton" />
<br />
<span id="Label1">Your name is Darrell</span>
</div>

I'm not getting value="Darrell" nor am I getting Your name is Darrell.

Can someone tell me why I'm not seeing this? Thanks in advanced for any help.
 
Old October 14th, 2010, 03:18 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 there,

Can you post the full code for the ASPX page and its Code Behind? Also, what's the extension of the page?

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!
 
Old October 14th, 2010, 10:09 AM
Registered User
 
Join Date: Sep 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to jarrettdd
Default

This the code for the control demo try it out.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ControlsDemo.aspx.vb" Inherits="Demos_ControlsDemo" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>

Your Name<asp:TextBox ID="YourName" runat="server"></asp:TextBox>
<asp:Button ID="SubmitButton" runat="server" Text="Submit Information" />
<br />
<asp:Label ID="Label1" runat="server"></asp:Label>

</div>
</form>
</body>
</html>


This is the code for the code behind once it's open in the in the browser.


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title></head>
<body>
<form method="post" action="ControlsDemo.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjA3NjE4MDczNmRkFadufUc6qggDIflm8WyU37blw/C2rPbJauvOQg2tZfI=" />
</div>

<div class="aspNetHidden">

<input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="/wEWAwK88/jNBgLTydp0ArK44tQLZ67avkaifOh3sOqseMFW9iU9z8b2I06i +vgFHd40m0A=" />
</div>
<div>

Your Name<input name="YourName" type="text" id="YourName" />
<input type="submit" name="SubmitButton" value="Submit Information" id="SubmitButton" />
<br />
<span id="Label1"></span>

</div>
</form>
</body>
</html

This isn't stopping me from moving forward I just wanted to know why the "value = My Name" is not showing and if it will cause problems for me later.

Thanks for your help
 
Old October 14th, 2010, 10:15 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 there,

Can you post two more things?

1) The Code Behind for the demo page

2) The final HTML in the browser that appears after you entered your name and clicked the button.

Cheers,

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
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Chapter 2 - End of chapter exercises whizzkid1892 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 July 30th, 2008 12:02 PM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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