redirect to different urls in html for if I have 2 servers using the same page RRS feed

  • Question

  • If I have 2 servers, one of them for test and the other for the client use. I have an application that is deployed on the both and it has HTML master page in asp.net web forum. The master page contains a drop down list which contains Logout.

    What I want is, if the user clicks on the logout for the local test it should redirect him to a link for example: www.testlogout.com

    and I want it for the client to redirect it to another page for example: www.Clientpage.logout.

    How Can I do it in my html master page?

     If you can show me an example I will be grateful.


    Friday, October 4, 2019 6:34 PM

All replies

  • Hello,

    Here is where to ask


    Please remember to mark the replies as answers if they help and unmarked them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.

    NuGet BaseConnectionLibrary for database connections.

    profile for Karen Payne on Stack Exchange

    Friday, October 4, 2019 7:10 PM
  • I think that the best solution would be to put the redirect address in an appSetting in the web.config file. In the master page, just read the appSetting using the ConfigurationManager, and then redirect to the value that you have read.

    The test server and the production server would have different web.config files. If you want to apply automatically the different configuration during deployment, there is a mechanism in Visual Studio that transforms the web.config according to your configuration:


    Sunday, October 6, 2019 7:29 PM