In an online tutorial I am following I have been given a task I can't get my head around. The task is to make a setting in LINQ (done), make an .asp controller (done) and programatically make the setting either Show/Hide the content of the .asp controller. So my question is, how do I make the controller show/hide with C#? I had some help making the setting for LINQ, and the start of the C# as shown, but I'm not sure how to finalize it. Any help is appreciated.
I am self thought and started programming about 2 weeks weeks ago so you have to excuse me for any obvious answers.
Thanks
Source code:
private bool isShowNyhetsMail()
{
bool value;
return (!bool.TryParse(App.Setup.GetSettingValue(CategoryName.Edm, SettingName.ShowNyhetsMail), out value)) ? true : value;
CheckBox_Nyheter.Visible = isShowNyhetsMail();
}
.asp controller
<mc:McCheckBox ID="CheckBox_Nyheter" runat="server" TabIndex="25" Text="<%$ Resources:CUSTOMER_REGISTRATION, Check_NewsOffers %>" ResourceObject="CUSTOMER_REGISTRATION" ResourceName="Check_NewsOffers" />
The line
CheckBox_Nyheter.Visible = isShowNyhetsMail();
Won't be executed since there is a return statement before that.
The statements after the return
statement will not be executed. Use that particular statement before return
.