|
-
Nov 7th, 2003, 11:22 PM
#1
Thread Starter
Lively Member
form action doesnot work??
Hi
I tried to post a form to another form.. but the form is not submitted to the form specified in the action property..
Eg. In webform2.aspx
<form method="post" action="webform3.aspx">
but the form is submitted to webform2.aspx??
wot to do if i need to submit to a different form??
if i cant submit to a different form, then why is the action attribute allowed in form element??
thanks
Akalya
-
Nov 8th, 2003, 07:52 PM
#2
Hyperactive Member
I dont know why it allows a method in an asp.net form because any asp.net form (i.e. with runat=server) will always post to itself.
I highly recommend you consider using this model because it works quite well and in most cases posting from one form to another can be avoided.
If however you really need to do so there are ways to do it without posting the form to another page using cookies or session variables and then redirecting to your second page.
-
Nov 11th, 2003, 12:42 AM
#3
Thread Starter
Lively Member
posting a form and getting values in diff form without using cookies or session
Hi
Thanks for ur reply...Wot u say is to assign the values of all the form values to cookies or session variables and then redirect to the form i want to post it to..
But cookies cannot be used since the user may be disabled cookies.. disabling cookies will also prevent using session variables since sessionid is stored in the client machine..
Is the only way to send the form variables in the form of querystring??
Akalya
-
Nov 11th, 2003, 04:13 AM
#4
New Member
no u can still use request.form if u use htmlcontrols. if u gonna use servercontrol u need to use their text proberty.
small example:
Code:
<%@ Page Language="VBScript" Debug="true" %>
<script runat="server" language="vb">
Sub btnsubmit_click(Sender As Object, E As EventArgs)
response.Write("HtmlControl: " + request.Form("htmlcontrol"))
response.Write("<br>ServerControl: " + servercontrol.text)
End Sub
</script>
<html>
<body>
<form runat="server">
<input type="text" name="htmlcontrol">
<asp:TextBox ID="servercontrol" runat="server" />
<asp:Button ID="submitbtn" runat="server" OnClick="btnsubmit_click" Text="submit" />
</form>
</body>
</html>
-
Nov 13th, 2003, 12:13 AM
#5
Thread Starter
Lively Member
no.. it works for posting to the same form only
Hi
wot u did is posted to the same form.. wot do u do to post it to a diff form??
u cannot access this way?.. the only soln is to redirect and use session/Cookie variables or redirect to a page with query string attached.. Am i right
thanks
-
Nov 13th, 2003, 08:10 AM
#6
New Member
hmmm, havnt tried it yet to post to a diff form, cuz there was no need to. i think posting to the same page is one of the great benefits asp.net supports, and u can save through this a lot of pages.
but to ur question, it should be still possible if u only use htmlcontrols or when ur form tag has no runat=server method, maybe u give this a try.
greetings
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|