Solved

Performing an actual form post from Asp.net code behind

Posted on 2014-03-20
4
373 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 110

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

691 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