0

I have a mvc program which can be run in 2 environments dev and prod. I referred to this program in https://www.codeproject.com/Articles/17660/Single-web-config-file-across-all-environments-dev and attached ConfitIt.dll to my MVC program. In Global.asax.cs and Application_Start method, I included

String environment = EnvironmentSettings.Environment;

In the Index.cshtml, I have a button whose value needs to change depending on environment I want it to display "Push to" + whatever environment it's in This is the code I have

<input type="submit" value="Push to" +EnvironmentSettings.Environment style="height:40px; width: 60px;font-weight: bold;background-color:#b6ffff; " /> <br />

I know this is wrong because I don't see the value. I tried this

@Html.Label("dynamic settings", EnvironmentSettings.Environment) 

and I see the correct value

How can I do this or is there an alternate way instead of ConfigIt.dll? Thanks MR

1 Answer 1

1

Write as follows:

<input type="submit" value='@("Push to" + EnvironmentSettings.Environment)' style="height:40px; width: 60px;font-weight: bold;background-color:#b6ffff; " /> <br />
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.