1

I have in the main web.config file under the

<system.web.webPages.razor>

a line that calls for a particular resource

<add namespcae="***.resources.male"/>

Now I want to change this line to

<add namespcae="***.resources.female"/>

only if the user is identified as female.

It is possible to check whether the user is male or female through a condition in the web.config file?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
דניאל
  • 183
  • 9
  • 2
    Sounds like an [XY Problem](https://xyproblem.info). Seems like you should load both resources and choose to show one set depending on the user... – Heretic Monkey Jul 30 '20 at 19:57
  • Thanks for the response, the problem is that there are a lot of pages in the project according to the method you suggest I have to follow this condition for each page. – דניאל Jul 30 '20 at 20:02
  • 1
    Depends on how you use resources. Should be easy enough to write a helper function that takes the resource key and the "male"/"female" string and get the appropriate resource. There are a few questions about dynamically loading resources (e.g., [How to dynamically load and switch the resource file in the web app (ASP.NET) without recompiling?](https://stackoverflow.com/q/1649226/215552) and/or [Getting a string dynamically from strings resources](https://stackoverflow.com/q/13194293/215552) – Heretic Monkey Jul 30 '20 at 20:32

0 Answers0