 |
| 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
|
|
|
|

August 17th, 2004, 11:56 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

August 18th, 2004, 12:14 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
Yes, you can use multiple forms. What is the error you are getting?
|
|

August 18th, 2004, 12:24 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 596
Thanks: 1
Thanked 3 Times in 3 Posts
|
|
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.
======================================
|
|

August 18th, 2004, 12:29 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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".
|
|

August 18th, 2004, 01:04 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 128
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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?
|
|

August 18th, 2004, 08:30 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
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
|
|

August 18th, 2004, 09:32 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 540
Thanks: 0
Thanked 4 Times in 4 Posts
|
|
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.
|
|

August 18th, 2004, 09:38 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 1,101
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
I always forget panels! Doh!
Hal Levy
Web Developer, PDI Inc.
NOT a Wiley/Wrox Employee
|
|

August 18th, 2004, 03:37 PM
|
 |
Friend of Wrox
|
|
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
|
|
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.
|
|

August 20th, 2004, 10:01 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 623
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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.:)
|
|
 |