?
Solved

vb.net post

Posted on 2010-04-08
4
Medium Priority
?
391 Views
Last Modified: 2012-05-09
I'm trying to create a vb.net button that will redirect a user to another site while appending a query string based on user entries & that will do a post instead of a get. The page unfortunately is an aspx page that inherits 2 master pages, user controls, includes ajax, etc. so I can't just create a standard html page. Is there a way to do this?
0
Comment
Question by:robanddeanna
  • 2
  • 2
4 Comments
 
LVL 9

Expert Comment

by:blandyuk
ID: 30151737
If you generating a query string on the end of the URL, why do you need to do a POST request? The easiest way is applying a onclick event to a button:

<asp:Button ID="btnDoIt" Text=" Go " runat="server" />

Code:

btnDoIt.Attributes.Add("onclick", "window.open('http://www.domain.com/page.aspx?id=123');")
0
 

Author Comment

by:robanddeanna
ID: 30156450
Thank you for the tip but unfortunately I have already tried that & it does not work. The reason I want the button to do the post is because I have a hotel reservation form on our site that sends the URL & query string. If I do this in a standard (client side) html page, it works fine. However, if I do this in a server side aspx page, it does not. Instead it takes me to another reservation form that is hosted on the external site. I need to bypass the external reservation form & have it take me directly to the list of available hotel rooms & rates for the dates entered by the user.
0
 
LVL 9

Accepted Solution

by:
blandyuk earned 2000 total points
ID: 30181437
mmmmm, I don't see any other way of doing this apart from used .net WebRequest, WebResponse classes and passing the POST via that. Here is a site for reference:

http://www.winsocketdotnetworkprogramming.com/httpgetrequestdotnetworkprogramming10f.html

I'll see if I can find anything easier.
0
 

Author Closing Comment

by:robanddeanna
ID: 31712571
Thank you for your help - unfortunately, I will not have time to test or try this as it appears to be quite involved.  I appreciate your time.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying 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

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

592 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