Link to home
Start Free TrialLog in
Avatar of robanddeanna
robanddeanna

asked on

vb.net post

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?
Avatar of blandyuk
blandyuk
Flag of United Kingdom of Great Britain and Northern Ireland image

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');")
Avatar of robanddeanna
robanddeanna

ASKER

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.
ASKER CERTIFIED SOLUTION
Avatar of blandyuk
blandyuk
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.