mercredi 29 novembre 2017

Accessing and comparing web.config variable values in an ASPX page

I have an appSetting variable in web.config configured as follows :

<add key="AllowMail" value ="true"/>

In my UI, I have a checkbox "Notify Me".

Now I want this checkbox to be rendered only when the AllowMail is configured as "true" or else I don't want this checkbox to be rendered/visible in the UI at all.

So how can I put such check in my ASPX page itself?

Checkbox code is as follows :

<asp:CheckBox ID="NotifyChkBx" runat="server" Text="Notify Me" />




Aucun commentaire:

Enregistrer un commentaire