469,625 Members | 1,914 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,625 developers. It's quick & easy.

Creating ASP.NET forms, that act like HTML forms

Question:

I'm creating an ASP.NET webform and I have questions about how the
ASP.NET form works. In ASP or
HTML a form with an action will transfer that forms items to another
page.

From the documentation I have read, there is nothing that describes
the use of the forms action
atribute. I did find text on the MSDN that describes the use of
Server.Transfer and Response.Redirect.

A simple Submit use of the "action" attribute doesn't seem to exist.

Is there a default way to submit a webform in ASP.NET as in HTML or
ASP? Yes I can store the form
data in a class, store the class in the session, retrive it from the
session as needed.
Thanks for any help :?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 19 '05 #1
2 1422
Forms in ASP.NET postback to the same page that rendered them so you can
take advantage of the object model. When you postback all of the server side
controls are recreated and repopulated with the values that are posted back
to the page. This provides for a much higher level programming model, and
therefore makes you as the developer more productive.

Now, if you really want to post to a second page, you can. But then you're
back to [old] ASP style Request.Forms programming.

As an aside, in ASP.NET v2.0 you can do a cross page postback without sacrificing
the ASP.NET object model.

-Brock
http://staff.develop.com/ballen
Question:

I'm creating an ASP.NET webform and I have questions about how the
ASP.NET form works. In ASP or
HTML a form with an action will transfer that forms items to another
page.
From the documentation I have read, there is nothing that describes
the use of the forms action
atribute. I did find text on the MSDN that describes the use of
Server.Transfer and Response.Redirect.
A simple Submit use of the "action" attribute doesn't seem to exist.

Is there a default way to submit a webform in ASP.NET as in HTML or
ASP? Yes I can store the form
data in a class, store the class in the session, retrive it from the
session as needed.
Thanks for any help :?

Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com


Nov 19 '05 #2
Setting the action attribute just isn't the ASP.NET way.
If you really must do it though, here are some tips:

1) Output an old fashioned non-server form to the client (without the runat=
'server' attribute) Set the action attribute like you would have in
ASP.OLD, and use javascript to submit the form.
2) use client side script to change your ASP.NET form action attribute
3) use this webform control: http://www.wilsondotnet.com/Controls/

Note: In ASP.NET 2.0 you will be able to more easily post to another page.

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net
"jlopes151" <jl*******@comcast-dot-net.no-spam.invalid> wrote in message
news:42**********@127.0.0.1...
Question:

I'm creating an ASP.NET webform and I have questions about how the
ASP.NET form works. In ASP or
HTML a form with an action will transfer that forms items to another
page.

From the documentation I have read, there is nothing that describes
the use of the forms action
atribute. I did find text on the MSDN that describes the use of
Server.Transfer and Response.Redirect.

A simple Submit use of the "action" attribute doesn't seem to exist.

Is there a default way to submit a webform in ASP.NET as in HTML or
ASP? Yes I can store the form
data in a class, store the class in the session, retrive it from the
session as needed.
Thanks for any help :?
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Matt Warner | last post: by
1 post views Thread by Don Stefani | last post: by
2 posts views Thread by Pawan | last post: by
6 posts views Thread by Adam Tilghman | last post: by
1 post views Thread by lxyone | last post: by
4 posts views Thread by Ryan Knopp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.