foreach (Control ct in form1.Controls)
{
if (ct.GetType() == typeof(HtmlInputRadioButton))
{
if (ct.ID.Contains("Screens"))
{
if (ModuleString.Contains("_" + ((HtmlInputRadioButton)ct).Value + "_"))
{
((HtmlInputRadioButton)ct).Checked = true;
}
}
if (ct.ID.Contains("Permission"))
{
if (PermissionString.Contains("_" + ((HtmlInputRadioButton)ct).Value + "_"))
{
((HtmlInputRadioButton)ct).Checked = true;
}
}
}
else if (ct.GetType() == typeof(HtmlInputCheckBox))
{
if (ct.ID.Contains("Screens"))
{
if (ModuleString.Contains("_" + ((HtmlInputCheckBox)ct).Value + "_"))
{
((HtmlInputCheckBox)ct).Checked = true;
}
}
if (ct.ID.Contains("Permission"))
{
if (PermissionString.Contains("_" + ((HtmlInputCheckBox)ct).Value + "_"))
{
((HtmlInputCheckBox)ct).Checked = true;
}
}
}
}