473,322 Members | 1,307 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,322 software developers and data experts.

Any way to include an HTML form with server-side controls?

Hi all,

I have a page with a mutli view control where one of the views needs to
contain a separate HTML get form with a submit button that goes to
another page. In ASP this was no problem - there was no container form
and it just went to the target page. In ASP .NET however, there is a
container form and having an embedded form breaks the page. Adding
another server-side form just gets the "A page can have only one
server-side Form tag" runtime error.

I need to have some server-side logic in the HTML form to determine
whether it is displayed or not. I can use the same form and catch the
server-side Click event for the other button, but that relies on
javascript to wire up a default button for the main form.

How can I achive this in .NET *without using javascript*?

Thanks,

Paul

Sep 5 '06 #1
4 1229
Hi,

Paul wrote:
Hi all,

I have a page with a mutli view control where one of the views needs to
contain a separate HTML get form with a submit button that goes to
another page. In ASP this was no problem - there was no container form
and it just went to the target page. In ASP .NET however, there is a
container form and having an embedded form breaks the page. Adding
another server-side form just gets the "A page can have only one
server-side Form tag" runtime error.

I need to have some server-side logic in the HTML form to determine
whether it is displayed or not. I can use the same form and catch the
server-side Click event for the other button, but that relies on
javascript to wire up a default button for the main form.

How can I achive this in .NET *without using javascript*?

Thanks,

Paul
The "one form" limitation is a real PITA.

Does it absolutely have to be a button? Changing a button's default
action without using any JavaScript is AFAICS impossible...

If you can use a hyperlink instead, then it's easy to make a GET

http://www,domain.com/page.aspx?para...&param2=value2

Why can't you use any JavaScript at all?

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 5 '06 #2
Hi Laurent,

I have a general UI preference of using buttons for attracting a user's
attention. I want to avoid javascript so that I know it will work for
everyone.

Is a link the only other non-javascript alternative?

Thanks,

Paul

Laurent Bugnion wrote:
Hi,

Paul wrote:
Hi all,

I have a page with a mutli view control where one of the views needs to
contain a separate HTML get form with a submit button that goes to
another page. In ASP this was no problem - there was no container form
and it just went to the target page. In ASP .NET however, there is a
container form and having an embedded form breaks the page. Adding
another server-side form just gets the "A page can have only one
server-side Form tag" runtime error.

I need to have some server-side logic in the HTML form to determine
whether it is displayed or not. I can use the same form and catch the
server-side Click event for the other button, but that relies on
javascript to wire up a default button for the main form.

How can I achive this in .NET *without using javascript*?

Thanks,

Paul

The "one form" limitation is a real PITA.

Does it absolutely have to be a button? Changing a button's default
action without using any JavaScript is AFAICS impossible...

If you can use a hyperlink instead, then it's easy to make a GET

http://www,domain.com/page.aspx?para...&param2=value2

Why can't you use any JavaScript at all?

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 5 '06 #3

Paul wrote:
I have a general UI preference of using buttons for attracting a user's
attention. I want to avoid javascript so that I know it will work for
everyone.
You could use CSS to make the link look like a button, or use an image
instead of text for the link.

--
BVH

Sep 5 '06 #4
Hi,

Paul wrote:
Hi Laurent,

I have a general UI preference of using buttons for attracting a user's
attention. I want to avoid javascript so that I know it will work for
everyone.

Is a link the only other non-javascript alternative?

Thanks,

Paul

Laurent Bugnion wrote:
In that case I recommend using Bart's proposed solution (an image
looking like a button). A strictly no-JavaScript solution will only be
able to submit the form using the target defined in the "action" attribute.

Non-JavaScript enabled solutions must rely on the most basic HTTP
mechanisms only, and they are very primitive. ASP.NET (with the "one
form" restriction) made it even more restrictive, unfortunately.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
Private/Malaysia: http://mypage.bluewin.ch/lbugnion
Support children in Calcutta: http://www.calcutta-espoir.ch
Sep 5 '06 #5

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

Similar topics

0
by: jason | last post by:
What is the best way to handle global includes for 3 subwebs that may at various times consume similiar include files such as ENQUIRY FORMS. I ask this question as I now have the oppportunity to...
14
by: Long | last post by:
How to include an HTML doc in another HTML doc Problem: to insert the body section of an HTML doc in another HTML document at a specific location. One possible way is to add a WebCharm tag...
3
by: JH | last post by:
I'm new in the .NET world, so sorry if this is a faq. In classic ASP I often use a include file with some standard functions, ex. formating a string an so. How do a do this i .NET ?? In my test...
2
by: Ben Turner | last post by:
Hi, I need to create an ASPX page that includes both traditional HTML Forms (which are submitted to a third-party site like a travel booking service) and also make use of the ASP.Net form. I've...
2
by: Kraai | last post by:
in normal asp , and even php i could use the <!--#include file="login.aspx" --> or <!--#include virtual="login.aspx" --> to include pages in my main page without using frames! when i try...
2
by: Jer425 | last post by:
Hello, I'm coding in VB and trying to include a jscript file. This will not work because you can only use one language in asp.net. Is there a way that I can use the jscript without having to...
3
by: Dave Kelly | last post by:
Given this html code page; ======begin <html> <body> <!--#include file="outing.1.shtml"--> <form action="form.php" method="GET"> <input type="hidden" name="op" value="ds"> <table width="468"...
11
by: cybervigilante | last post by:
I can't seem to change the include path on my local winmachine no matter what I do. It comes up as includ_path .;C:\php5\pear in phpinfo() but there is no such file. I installed the WAMP package...
6
by: vinnie | last post by:
this is my include file that i have uploaded on the server called DB_1.php <?php function connect() { // SERVER connection $con=mysql_connect('host', 'My_user_ID', 'My_Pwd'); // DB...
6
by: j.woodcock | last post by:
is there a way of having a file that's name is a variable (eg dependant on the user name) act like a include. i know that you cant define the file for an include asp tag using a variable and that...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.