ModuleController controller2 = new ModuleController();
int num = 0;
ModuleInfo module = controller2.GetModule(base.ModuleId, base.TabId);//get current module
foreach (KeyValuePair<int, ModuleInfo> pair in controller2.GetTabModules(base.TabId))
{
if (!pair.Value.IsDeleted && (pair.Value.ModuleDefID == module.ModuleDefID))
{
num++;
}
}
if num value is over 1 then there are multiple same modules exist in the current
page(tab).
if that helped don't forget to +1 this in google search.