Solved

Performing an actual form post from Asp.net code behind

Posted on 2014-03-20
4
366 Views
Last Modified: 2014-03-25
Hello, I am in the process of making some asp.net/php integrations and I need to be able to load an asp.net page, and as soon as that page opens do an actual form post of two custom values to a php page.  The php page then reads to values and loads them to the database.

My issue is that I am having trouble trying to figure out how to do an actual form post where the page redirects to the php page (just as if I were doing a form post with a submit button).  I do know how to form post from asp.net code behind, but when I do that the page does not redirect.  How can I do a real form post as soon as the asp.net page loads to the php page?
0
Comment
Question by:jtmerch
  • 2
4 Comments
 
LVL 82

Expert Comment

by:Dave Baldwin
Comment Utility
I don't think you can because the post from the 'code behind' does not involve the browser at all.  The best you could do is to perform the post and redirect the browser when you get a response.  That is often done with PHP only code.
0
 

Author Comment

by:jtmerch
Comment Utility
Wow so there is no way to just automate a true form post in .net?
0
 
LVL 82

Accepted Solution

by:
Dave Baldwin earned 500 total points
Comment Utility
I think you're confusing things.  If you were to do the form post from the web page in the browser, the browser would go to that page.  But when you do it in the code behind on the server, it does not involve the browser.  In fact the browser knows nothing about it so there is nothing to take it to that next page.  

And it's not just .NET.  The same thing is true in all the other server side languages.  The browser doesn't know about anything you do on the server unless the info is sent to the browser.
0
 
LVL 108

Expert Comment

by:Ray Paseur
Comment Utility
I think a bit of Client / Server theory may be helpful to you as you seek to frame the problem.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/A_11271-Understanding-Client-Server-Protocols-and-Web-Applications.html
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now