0

Possible Duplicate:
How to create a generic MVC3 editor template?

I am using editorfor as my input control and this is going out of my form when the screen resolution is low. I need to reduce the width of the control to fix this problem. I am trying to write an editor template for this but i am not figure out how. Please help me here.

Community
  • 1
  • 1
Rash
  • 447
  • 1
  • 8
  • 12
  • I have the below code for a texbox control but i am not able to write for editorfor control @Html.TextBox("", string.Format("{0:0.00}", Model), (@Model.GetValueOrDefault() < 0) ? new { style = "color:red; width:150px;" } : new { style = "color:#000000; width:150px;" }) – Rash Dec 21 '12 at 16:30
  • Are you asking how to [create custom EditorFor templates](http://bradwilson.typepad.com/blog/2009/10/aspnet-mvc-2-templates-part-3-default-templates.html), or how to style the inputs with CSS? – Evan Davis Dec 21 '12 at 16:41
  • I need to create custom editorfor template. The width of the editor for control has to be reduced. – Rash Dec 21 '12 at 16:56

1 Answers1

1

Try looking at this link. They seemed to be able to manipulate the EditorFor field by wrapping it in a div and then using CSS to manipulate the div.

Community
  • 1
  • 1
IyaTaisho
  • 863
  • 19
  • 42