jquery - How to show hide particular control of partialView on some condition on pageLoad using asp.net mvc4 razor? -
i tried viewbag no use, gives me error as:
'syntaxerror: unexpected token illegal'
is there other way achieve this?
if can check condition in controller can send value in tempdata like
public action somecontrollermethod() { tempdata["displayvalue"] = @"""display: block"""; if(somecondition) { tempdata["displayvalue"] = @"""display: none"""; } return view(); }
and can use tempdata set disply property in view ex:
html.displayfor(x=>x.someproperty, new {@style=html.raw(tempdata["displayvalue"])});
Comments
Post a Comment