Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 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 September 29th, 2008, 05:06 AM
pas pas is offline
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter9, 295.

Hi there, I'm working on "try it out" page 294 "Using the RequiredFieldValidator". Well I thing to have done everything right but when I try to show the page "Contact us" I receive the following message error:

Server Error in '/Site' Application.
--------------------------------------------------------------------------------

A page can have only one server-side Form tag.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: A page can have only one server-side Form tag.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Is there anybody that can help me?
Thank you.

 
Old September 29th, 2008, 10:04 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

It sounds like you created a standard web form, then changed it to use the master page, which is resulting in two instances of a <form runat="server" ...>. Do you have <html> <body> and <form> in your page somewhere? When master pages, you should have that. Only one or more content tags.

-Peter
compiledthoughts.com
 
Old September 30th, 2008, 05:21 AM
pas pas is offline
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Peter,
those are the extra codes that have been created when I added the user control "ContactForm.ascx"

 <!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 id="Head1" runat="server">

I deleted the code and the "Contact us" page showed up.

Thank you,
Pasquale.

 
Old September 30th, 2008, 06:55 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 pas,

Are you sure you added a User Control instead of a page? Maybe you added a Web Form and then named it with an .ascx extension?

Normally, when you add a new User Control you shouldn't get the HTML you just posted.

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.
 
Old September 30th, 2008, 06:21 PM
pas pas is offline
Registered User
 
Join Date: Sep 2008
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes Imar, it is exactly what I have done.
I added a Web Form instead than a User Control then I changed aspx to ascx and Page to Control in the source code. Instead in the code behind, I changed System.Web.UI.Page to System.Web.UI.UserControl.
Although, I still couldn't realized that I was using wrong form.
Thanks for your help.
Pasquale.

 
Old October 1st, 2008, 04:55 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 Pasquale,

You're welcome. Glad it's working now.....

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of Beginning ASP.NET 3.5 : in C# and VB, ASP.NET 2.0 Instant Results and Dreamweaver MX 2004
Want to be my colleague? Then check out this post.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Big Bug on Page327, Chapter9 condescendent BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 April 30th, 2007 04:53 PM
Exception in chapter9 james.zeng BOOK: Beginning Cryptography with Java 2 January 11th, 2007 04:06 PM
Beginning ASP.NET 2.0 with C# - Chapter09 pg 295 tbroom BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 September 1st, 2006 02:35 PM





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