In my index.cshtml I want to display the WizardStepAttribute
Value
So, a user will see at the top of each page,
In our case we just needed an attribute that implements the IMetadataAware
interface:
https://msdn.microsoft.com/en-us/library/system.web.mvc.imetadataaware(v=vs.118).aspx
In your case, this could be:
public class WizardStepAttribute : Attribute, IMetadataAware
{
public string Name;
public void OnMetadataCreated(ModelMetadata metadata)
{
if (!metadata.AdditionalValues.ContainsKey("WizardStep"))
{
metadata.AdditionalValues.Add("WizardStep", Name);
}
}
}