Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / December 2007

Tip: Looking for answers? Try searching our database.

Form Post to Non-ASP.NET Page

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jonathan Wood - 11 Dec 2007 05:51 GMT
I raised this issue before and never got anywhere. Thought I'd try again to
see if anyone ever resolved this.

I want to do a FORM POST to a non-ASP.NET page on another site. I can do
this with a regular HTML <form> tag. However, this doesn't work well with
ASP.NET. ASP.NET pages must have the page content within a <form> tag in
order to use ASP.NET controls and handle their events. And, since the HTML
specification does not support nested <form> tags, this means I cannot add
another HTML <form> tag to perform a non-ASP.NET form post.

Ideally, it seems like I should be able to write a normal ASP.NET button
event handler, and have the handler emulate a form post (and redirection).

Unfortunately, I cannot get this to work. This would be a cool trick as
searching the Web found lots of people with the same problem but no
solutions.

Thanks!

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Alexey Smirnov - 11 Dec 2007 09:41 GMT
> I raised this issue before and never got anywhere. Thought I'd try again to
> see if anyone ever resolved this.
[quoted text clipped - 18 lines]
> Jonathan Wood
> SoftCircuits Programminghttp://www.softcircuits.com

Look for HTTP Post
http://www.dotnet247.com/247reference/msgs/19/95431.aspx
http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm
Jonathan Wood - 11 Dec 2007 19:38 GMT
Alexey,

>> I raised this issue before and never got anywhere. Thought I'd try again
>> to
[quoted text clipped - 26 lines]
> http://www.dotnet247.com/247reference/msgs/19/95431.aspx
> http://www.west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm

Thanks, but while this apparently seems like an easy problem at first
glance, neither of these solutions will forward to the page being posted to
per my description.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

Alexey Smirnov - 12 Dec 2007 07:52 GMT
> Alexey,
>
[quoted text clipped - 38 lines]
>
> - Show quoted text -

you can also do a simple redirect to the target page adding all fields
in the url

e.g. http://www.google.com/search?hl=en&q=asp

stays for

<input type=hidden name=hl value="en">
<input type=text name=q value="asp">

or try to use a client-side javascript to change the ASP.NET form
action attribute
Scott Roberts - 11 Dec 2007 16:09 GMT
> I want to do a FORM POST to a non-ASP.NET page on another site. I can do
> this with a regular HTML <form> tag. However, this doesn't work well with
> ASP.NET.

Sure it does, it's just not as obvious as one would hope. To post a ASP.NET
form to a different URL, use the PostBackUrl property on the submit button.
Jonathan Wood - 11 Dec 2007 19:32 GMT
That only works when posting to ASP.NET pages on the same server. As
described, I want to post to a non-ASP.NET page on another server.
PostBackUrl is of no value here.

Signature

Jonathan Wood
SoftCircuits Programming
http://www.softcircuits.com

>> I want to do a FORM POST to a non-ASP.NET page on another site. I can do
>> this with a regular HTML <form> tag. However, this doesn't work well with
[quoted text clipped - 3 lines]
> ASP.NET form to a different URL, use the PostBackUrl property on the
> submit button.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.