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

ASP.Net messes with my form's action attributes!

I have a form tag in my page (Metadata.aspx) as belo

<form id="Form1" method="post" runat="server" action="Metadata.aspx"

My problem is that when this page is accessed from other pages which pass parameters in the query string to Metadata.aspx these are then reflected in the form's action attribute so it looks like this..

<form name="Form1" method="post" action="MetaData.aspx?Param1=2&amp;Param2=z" language="javascript" onsubmit="ValidatorOnSubmit();" id="Form1"

I have tried using

((HtmlForm)Page.FindControl("Form1")).Attributes.A dd("action","Metadata.aspx") to override this behaviour but to no avail

Any ideas how I can turn this behaviour off?

Cheers

Marti

Nov 18 '05 #1
6 3103
A WebForm (runat=server) will always post back to itself. To create a form
that does not, it can't be a WebForm.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Martin" <an*******@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
I have a form tag in my page (Metadata.aspx) as below

<form id="Form1" method="post" runat="server" action="Metadata.aspx">

My problem is that when this page is accessed from other pages which pass parameters in the query string to Metadata.aspx these are then reflected in
the form's action attribute so it looks like this...
<form name="Form1" method="post" action="MetaData.aspx?Param1=2&amp;Param2=z" language="javascript"
onsubmit="ValidatorOnSubmit();" id="Form1">
I have tried using

((HtmlForm)Page.FindControl("Form1")).Attributes.A dd("action","Metadata.aspx
") to override this behaviour but to no avail.
Any ideas how I can turn this behaviour off??

Cheers!

Martin

Nov 18 '05 #2
A WebForm (runat=server) will always post back to itself. To create a form
that does not, it can't be a WebForm.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"Martin" <an*******@discussions.microsoft.com> wrote in message
news:65**********************************@microsof t.com...
I have a form tag in my page (Metadata.aspx) as below

<form id="Form1" method="post" runat="server" action="Metadata.aspx">

My problem is that when this page is accessed from other pages which pass parameters in the query string to Metadata.aspx these are then reflected in
the form's action attribute so it looks like this...
<form name="Form1" method="post" action="MetaData.aspx?Param1=2&amp;Param2=z" language="javascript"
onsubmit="ValidatorOnSubmit();" id="Form1">
I have tried using

((HtmlForm)Page.FindControl("Form1")).Attributes.A dd("action","Metadata.aspx
") to override this behaviour but to no avail.
Any ideas how I can turn this behaviour off??

Cheers!

Martin

Nov 18 '05 #3
Cheers

That's quite disappointing.

I would have expected a way to change this behaviour!
Nov 18 '05 #4
Cheers

That's quite disappointing.

I would have expected a way to change this behaviour!
Nov 18 '05 #5
I've found something which looks like it may do it here..

http://www.codeproject.com/aspnet/CHtmlForm.asp
Nov 18 '05 #6
I've found something which looks like it may do it here..

http://www.codeproject.com/aspnet/CHtmlForm.asp
Nov 18 '05 #7

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

Similar topics

1
by: Ronaldo N | last post by:
I'm trying to do some javascript form validation and I've discovered a rather difficult situation to handle with IE. Let's say there's a form with three input fields named "name", "method", or...
5
by: Jan Gregor | last post by:
Hello I want to change attribute action in form. Problem is that in that form is also input with name action. Unfortunately renaming of that input is worst case because many servlets depend on...
32
by: Eli | last post by:
How can I POST a form into a new window where I control the size and other attributes of the new window? Also. Are there any implications, perhaps due to browser security (Interne Explorer?)...
2
by: Myk Quayce | last post by:
I have a small .aspx page that uses old style forms with client-side JavaScript validation. Everything works fine until I try to upate the database with some new information. I must be doing...
3
by: Martin | last post by:
I have a form tag in my page (Metadata.aspx) as belo <form id="Form1" method="post" runat="server" action="Metadata.aspx" My problem is that when this page is accessed from other pages which...
3
by: Tabi | last post by:
Hi, I have just created a class that removes action attribute from HtmlForm. The code looks like here. namespace ComIT.Applications.Common { public class Form :...
4
by: Not Me | last post by:
Hi, I'm trying to translate a page into asp.net 2.0.. The options I need are e.g. action='some webpage', method=post, enctype='enctype' etc... the file is supplied by a standard file input...
13
by: deko | last post by:
I have a basic feedback form with a submit button. After the "send" button is clicked, I want the user to be redirected to a different page that says "Your message has been sent." How do I do...
4
by: wwwmike | last post by:
How can I overwrite the <FORM action=attribute? I can add new attributes with Dim xx As System.Web.UI.HtmlControls.HtmlForm xx = Page.FindControl("form1") xx.Attributes.Add("something",...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.