Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
| Search | Today's Posts | Mark Forums Read
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET 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 August 17th, 2004, 11:56 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Hyderabad, , India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default Multiple forms in one application

Can we use multiple forms in one application.
Showing error when we are using forms, we have given different ids for both the forms. Can anyone help me.

 
Old August 18th, 2004, 12:14 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Yes, you can use multiple forms. What is the error you are getting?
 
Old August 18th, 2004, 12:24 AM
Friend of Wrox
Points: 2,376, Level: 20
Points: 2,376, Level: 20 Points: 2,376, Level: 20 Points: 2,376, Level: 20
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: , , Australia.
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Are you talking about a windows app, or a web app.
Im not an expert but I do beleive that you can only have one ASP.NET form with the runat="server" attribute per page (ie: PostBack Form).



======================================
They say, best men are molded out of faults,
And, for the most, become much more the better
For being a little bad.
======================================
 
Old August 18th, 2004, 12:29 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Hyderabad, , India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have divided the page into three parts.On the top i am using one user control,on left i am using one more application. I am including the left and top forms in the third one. But displaying error that Only one form can be used with the server tag and sometimes displays "The page could not have two 'page' directive".

 
Old August 18th, 2004, 01:04 AM
Friend of Wrox
 
Join Date: Jun 2004
Location: Hyderabad, , India.
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is the error i am getting.
"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.
"
How to rectify this error?

 
Old August 18th, 2004, 08:30 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

OK- you should be clearer... This is obviously an ASP.NET question (You should post in one of the ASP.NET forums.. rather than general)...

If I may, it seems your trying to create two ASP.NET Forms on the same ASP.NET page. This is not something that is supported in ASP.NET. A solution might be to use a frameset or iframe with different forms in each frame..

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old August 18th, 2004, 09:32 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Yep, thought you were talking about a Windows app. What exactly are you trying to accomplish? In addition to Hal's suggestion, web forms can use panels to split the form into different segments.
 
Old August 18th, 2004, 09:38 AM
Friend of Wrox
Points: 3,489, Level: 24
Points: 3,489, Level: 24 Points: 3,489, Level: 24 Points: 3,489, Level: 24
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Central, NJ, USA.
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I always forget panels! Doh!

Hal Levy
Web Developer, PDI Inc.

NOT a Wiley/Wrox Employee
 
Old August 18th, 2004, 03:37 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

But panels still don't let you have more than one form on the page.

lily- can you describe what you are trying to do? How are you "including" two forms on one page? Perhaps you are missing the point of user controls.
 
Old August 20th, 2004, 10:01 AM
Friend of Wrox
 
Join Date: Jul 2004
Location: Tehran, , Iran.
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
Default

also without using usercontrols
(there is a simple way under some circumstances)
Have a look at
http://p2p.wrox.com/topic.asp?TOPIC_ID=17020
but still there is only one form
(lily611 why u escape when u ask a question?!!!I cant get)

--------------------------------------------
Mehdi.:)




Similar Threads
Thread Thread Starter Forum Replies Last Post
How many forms in an application Yasho Visual Basic 2005 Basics 1 December 27th, 2006 08:24 AM
Multiple forms simen C# 2005 1 February 8th, 2006 08:15 AM
Multiple forms one submit x_ray Classic ASP Basics 7 January 3rd, 2006 07:12 PM
Multiple forms? Thurston VB.NET 2002/2003 Basics 5 November 18th, 2005 05:14 PM
multiple forms johanyu VB.NET 2002/2003 Basics 2 October 10th, 2004 12:35 AM





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