473,771 Members | 2,372 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multiple Forms on page

hello,

I have to deal with the weird limitation of asp.net, as I need to have
multiple forms on my page, well three at least actually, one for the login,
one for the search engine, and another one for a certain bulletin list,
however asp.net allows only one form per page with runat="server" attribute,
I am aware of the visibility issue and that I can hide all of the forms
except one but this won't help cause I need all of the three forms visible.

The solution I got so far was to enclose all the body of the page with a
form tag (<body><form runat...>), however it doesn't appear to be a rational
solution to me; why would I put all the elements of the page in a form tag.
What other workarounds could I use?

Thanks
Yehia A.Salam

Apr 22 '07 #1
3 4095
On Sun, 22 Apr 2007 02:23:19 +0200, "Yehia A.Salam"
<ye*****@hotmai l.comwrote:
>hello,

I have to deal with the weird limitation of asp.net, as I need to have
multiple forms on my page, well three at least actually, one for the login,
one for the search engine, and another one for a certain bulletin list,
however asp.net allows only one form per page with runat="server" attribute,
I am aware of the visibility issue and that I can hide all of the forms
except one but this won't help cause I need all of the three forms visible.

The solution I got so far was to enclose all the body of the page with a
form tag (<body><form runat...>), however it doesn't appear to be a rational
solution to me; why would I put all the elements of the page in a form tag.
What other workarounds could I use?
Why look for a workaround to an artificial constraint? Use controls as
containers for the various piece parts instead of forms.

You may be in the situation where each of the existing forms use some
JavaScript. on the client-side to build query strings instead of
performing postbacks. If this is the case you may need to investigate
WriteClientScri ptBlock and similar methods of the System.Web.UI.P age
type to write the scripts at run time. At the same time you will need
to use controls' ClientID (decorated name) rather than the ID
property.

regards
A.G.
Apr 22 '07 #2
THe "weird limitation" you describe isn't a limitation at all, it's a
feature. Controls in an ASP.NET page need to be wrapped inside a form because
the entire postback event model depends on this.
There is no reason why a postback generated by any of your controls all of
which are wrapped inside a single FORM tag cannot handle individual specific
actions that your business logic dictates.
Peter

--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Yehia A.Salam" wrote:
hello,

I have to deal with the weird limitation of asp.net, as I need to have
multiple forms on my page, well three at least actually, one for the login,
one for the search engine, and another one for a certain bulletin list,
however asp.net allows only one form per page with runat="server" attribute,
I am aware of the visibility issue and that I can hide all of the forms
except one but this won't help cause I need all of the three forms visible.

The solution I got so far was to enclose all the body of the page with a
form tag (<body><form runat...>), however it doesn't appear to be a rational
solution to me; why would I put all the elements of the page in a form tag.
What other workarounds could I use?

Thanks
Yehia A.Salam
Apr 22 '07 #3
In addition to the other answers, you can still use "normal" FORMs without
the runat tag. You can post them to an ASPX page and use the Request object
to read the values.

"Yehia A.Salam" <ye*****@hotmai l.comwrote in message
news:5D******** *************** ***********@mic rosoft.com...
hello,

I have to deal with the weird limitation of asp.net, as I need to have
multiple forms on my page, well three at least actually, one for the
login, one for the search engine, and another one for a certain bulletin
list, however asp.net allows only one form per page with runat="server"
attribute, I am aware of the visibility issue and that I can hide all of
the forms except one but this won't help cause I need all of the three
forms visible.

The solution I got so far was to enclose all the body of the page with a
form tag (<body><form runat...>), however it doesn't appear to be a
rational solution to me; why would I put all the elements of the page in a
form tag. What other workarounds could I use?

Thanks
Yehia A.Salam

Apr 22 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
539
by: mark | last post by:
I have an asp.net ecommerce web application on a remote web server. I'm using an Access database on the back end. I've notice a few strange things. When I mimic an multiple user environment by surfin it in multiple browsers simultaneously the site generates a generic runtime error after awhile. I'm thinking this has something to do with my access database and multiple connections. I'm using forms authentication with a login page. Is...
2
4663
by: James X. Li | last post by:
Is there a way to implement multiple login forms for ASP.NET applications? With our application we want to implement simple login form for normal resources (downloadable files), but more rigorous login forms for tasks like administration and configuration. The current ASP.NET seems only to allow to a single login form via the authentication element in web.config in the root directory. One work-around for our problem is implementing a...
8
579
by: TJS | last post by:
what are folks doing to get around limitation of one server form per page ?
7
3113
by: Siv | last post by:
Hi, I have an MDI application that uses a generic "ShowPage" routine in a module that is called when I want to display a child form. The basic idea is that in the module I have declared each form as follows: Friend F0 As frmMain Friend F1 As frmStart Friend F2 As frmSearch Then in my ShowPage routine (which is passed a string "pageToShow" which is the name of the form I wish to open), I first check to see if we already have an instance...
5
20015
by: Alex Maghen | last post by:
In ASPX 2.0 with MasterPages and all that, my entire page only has one actual <FORM>. But there are several different sections of the page that provide what are functionally separate forms with separate Submit buttons. In basic HTML, I can have multiple forms on a page and the browser knows that if any of the fields for Form A have the focus, then pressing ENTER will send a Click to the submit button for Form A. Same for Form B, etc. ...
3
8718
by: imrantbd | last post by:
I need array type name like "destList" must use for my destlist select box,not a single name.Or need a solution to capture multiple value of "destList" select box and send all selected value in php page.The multiple select value then insert in database added by comma.The following is my code: Form Page:form.php <head> <script language="JavaScript"> function addSrcToDestList() { destList1 = window.document.forms.destList; srcList...
5
14132
by: c676228 | last post by:
Hi everyone, my colleagues are thinking about have three insurance plans on one asp page: I simplify the plan as follow: text box:number of people plan1 plan2 plan3
1
2436
by: draw | last post by:
I have one container page "container.htm" In this container I have multiple iframes "iframepage1.htm", "iframepage2.htm", etc. and one button firing a js script to submit. In every iframe page I have multiple input fields. In the container page I have one iframe page to display results "'iframeresults.htm". How can I send all the values of the input fields to one server page "process.php" where calculations are done and the results are...
2
2446
by: =?Utf-8?B?VGFtbXkgTmVqYWRpYW4=?= | last post by:
Hi, I am going to write a large application using Visual Studio C#. I am going to use only one Form as main menu and go to other pages by cliking on next button in each page. I dont want to create several forms and move from one form to next. However I need to have same action using only one form. Could someone show me how I can use only one form instead of multiple forms. Thanks -- Nejadian
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10260
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10102
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7460
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6712
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.