Solved

Performing an actual form post from Asp.net code behind

Posted on 2014-03-20
4
368 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 108

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
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…

867 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

21 Experts available now in Live!

Get 1:1 Help Now