I have created an web based application through which the users can change the server (where the web application is hosted) IPAddress.
The problem is that, once i have changed the IPAddress to a new IPAddress, Response.Redirect(“MyHome.aspx”) is not working any more. I have also tried to redirect the user to the newly updated address but even it doesn’t do the trick. No page found message appears after some time.
For example: The url while the web application runs in IIS is : http://192.168.0.65/WebDemo/Default.aspx after changing the IPAddress to 192.168.0.66 and redirecting it with the Response.Redirect() method the http://192.168.0.65 is not accessible.
Any idea of achieving this task of changing IPAddress of the server and doing an automatic redirect to the newly assigned IPAddress?
When the browser sends the request to change the IP address, a TCP session is created between the client and your server. The browser waits on that connection for a response.
Changing the IP address of the server breaks the session, so the server cannot send data back over that link.
You would need to send the redirect before you actually change the IP address. (Better: send a page with a timed redirect using javascript or a meta refresh or something.)