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

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -