473,385 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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 4071
On Sun, 22 Apr 2007 02:23:19 +0200, "Yehia A.Salam"
<ye*****@hotmail.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
WriteClientScriptBlock and similar methods of the System.Web.UI.Page
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*****@hotmail.comwrote in message
news:5D**********************************@microsof t.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
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...
2
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...
8
by: TJS | last post by:
what are folks doing to get around limitation of one server form per page ?
7
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...
5
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...
3
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...
5
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
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...

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.