title: How can I redirect to a website on a remote server using server side code in an MVC web application?
body: <p>I am trying to create an ASP.NET MVC web application which connects to a certain website, which I will call website1, on a certain server, which I will call server A, and from this server the user is able to connect to another website, which I will call website2, on a different server, which I will call server B. Server B and any website therein is only accessible from Server A so the redirect from website1 to website2 must be done using server side code. The user needs to be able to initiate the connection to website2 using something similar to a button or a hyperlink. </p>
  
  <p>I am aware that code within a code block of a view which is denoted by @ does run on the server side, but I cannot get code like this to be called in response to user interaction.The <code>OnClick()</code> handler for the <code>&lt;a&gt;&lt;/a&gt;</code> tag does not let me call a helper method of the view which might run on the server and neither does <code>@Html.ActionLink()</code>. I can call a method of the controller using <code>@Html.ActionLink("caption","method name")</code> though I cannot figure out how to write server side code here which will connect me to website2. <code>Server.Transfer</code> does not work because this only works for redirecting to pages on the same server. <code>Response.Redirect</code> is also out because this uses the client's browser through which server B and website2 would not be accessible.    </p>
  
  <p>I would greatly appreciate any direction on resolving this matter as I do not quite know where to go from here. I have been doing searches extensively but have seen nothing which seems to fit with my situation. Please let me know if I have missed anything and I will gladly check it out. </p>