Link to home
Start Free TrialLog in
Avatar of Hassan_Ghanem
Hassan_GhanemFlag for Saudi Arabia

asked on

submit a form to another web page using ASP.NET

Hello every body..
I am learning ASP.NET these days..
when I was reading ASP.NET I noted that all examples submit a postback form.. I want to know how can I submit a form to another web page?
and Thanks in advance...
(Hassan Ghanem)
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Hassan,

I have moved this to the ASP.NET topic area where I think you will have a better chance of getting a solution.

COBOLdinosaur
Page Editor, Web Development
Avatar of dfiala13
dfiala13

Theoretically, yes.  Though ASP.NET is really designed to post back.   When you post to another page you lose a lot of the power of the ASP.NET development model including the ability to easily refer to controls on the page as objects.

This is definitely a change from the classic ASP model, but you'll probably find development in ASP.NET easier if you follow the post back model.  If you need to move to another page on a submit, you can use Server.Transfer or Response.Redirect to move to the proper page.
If you use Server.Transfer you "redirect" the Request Collection to the new page and ends the execution of current page
The Response.Redirect works like in the pure ASP so it just redirect you nothing else

B..M
Check out:

http://www.codeproject.com/aspnet/CHtmlForm.asp

Very cool method of providing an action attribute that posts to another site.

Good Luck,
Steve
ASKER CERTIFIED SOLUTION
Avatar of ihenry
ihenry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial