asp.net mvc - Conditional HiddenInputAttribute -


i need attribute in asp .net mvc view model, check specified condition (based on property value) , turn on/off visibility parameter of input control on edit page.

something that:

public string someproperty { get; set; }  [conditionalhidden("someproperty", "propertyvaluetomakeconditiontrue")] public string dependentproperty { get; set; } 

is possible?

if need after page loaded need javascript code.

else can use in view

@if(model.property == something)     {         html     } 

but without attribute.


Comments