Solved

Performing an actual form post from Asp.net code behind

Posted on 2014-03-20
4
369 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 83

Expert Comment

by:Dave Baldwin
ID: 39943443
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
ID: 39943597
Wow so there is no way to just automate a true form post in .net?
0
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39943780
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 109

Expert Comment

by:Ray Paseur
ID: 39944100
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

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Wordpress Pagination Function Not working ? 7 32
imap mails 1 23
Example works but why do I need to click twice on button 4 43
PHP not parsing ' character 12 40
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

810 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