ASP.NET

Moderators: None (Apply to moderate this forum)
Number of threads: 1727
Number of posts: 3292

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
setting the action in an aspx form Posted by jdrodas on 20 Jan 2003 at 3:02 PM
Hi everyone!

I'm just started writing a .NET app and I've already smashed myself against the wall!

Can you people tell me how can I set a different action to my form instead of the default one? my page's name is default.aspx and the code I wrote was:

<form name="frm1" method="post" action="vA.aspx" runat="server">
<asp:TextBox id="mytxt" runat="server" />
<input type="submit" value="Next ->" name="btnNext">
</form>

But When I look at the code in the html of the compiled page I see:

<form name="frm1" method="post" action="default.aspx" id="frm1">
<input type="text" id="mytxt">
<input type="submit" value="Next ->" name="btnNext">
</form>

What am I doing wrong?

Thank you in advance....

JuanD
Report
Re: setting the action in an aspx form Posted by NC01 on 9 Feb 2003 at 11:12 AM
You can't do that in ASP.NET as the form has to PostBack to itself to maintain state. To go to another page use either:
Response.Redirect("next-page.aspx");
or
Server.Transfer("next-page.aspx");

HTH,
NC...

: Hi everyone!
:
: I'm just started writing a .NET app and I've already smashed myself against the wall!
:
: Can you people tell me how can I set a different action to my form instead of the default one? my page's name is default.aspx and the code I wrote was:
:
: <form name="frm1" method="post" action="vA.aspx" runat="server">
: <asp:TextBox id="mytxt" runat="server" />
: <input type="submit" value="Next ->" name="btnNext">
: </form>
:
: But When I look at the code in the html of the compiled page I see:
:
: <form name="frm1" method="post" action="default.aspx" id="frm1">
: <input type="text" id="mytxt">
: <input type="submit" value="Next ->" name="btnNext">
: </form>
:
: What am I doing wrong?
:
: Thank you in advance....
:
: JuanD
:




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.