I have classes those are strongly bound with the ASP.NET MVC view. Against their fields/properties ( columns ), I have to generate a unique name using Guid.NewGuid(). In this way, every time view would open , there would be new unique name against every control which is associated with specific field/column inside that class.
But, I would like to skip some of the properties while generating unique name. Because, those properties are either hidden inputs or place holders for other specific purpose. What could be the nice way? Should I apply custom attribute for this? During iteration of fields, I would simply skip those fields.
For example the class is "
public abstract class DashboardModuleCommonSettings
{
public int ForwarderId { get; set; }
public int ClientSubsidiaryId { get; set; }
public bool IsContentUpdateable { get; set; }
public int? AfterTime { get; set; }
public string Title { get; set; }
[Not Required to be iterated for generating unique name]
public string ModuleSettingsPopupName { get; set; }
[Not Required to be iterated for generating unique name]
public int ClientId { get; set; }
[Not Required to be iterated for generating unique name]
[HiddenInput(DisplayValue = false)]
public string CurrentLayout { get; set; }
}
How can I achieve this?
Aucun commentaire:
Enregistrer un commentaire