editorfor Questions

13

Solved

Can I set the width of an EditorFor control on my View? I have set a few parameters: [Required, DisplayName("Payee Name"), StringLength(50)] public string Name { get; set; } However, I can't se...
Cholon asked 18/1, 2011 at 5:55

12

Solved

I want to make readOnly with EditorFor in edit page. I tried to put readonly and disabled as: <div class="editor-field"> @Html.EditorFor(model => model.userName, new { disabled = "disab...
Hoeve asked 11/4, 2012 at 15:33

7

Solved

Is there a way to write the Html5 placeholder using @Html.EditorFor, or should I just use the TextBoxFor extension i.e. @Html.TextBoxFor(model => model.Title, new { @placeholder = "Enter title ...
Gonta asked 28/4, 2011 at 19:49

3

Solved

I need to use datepicker on an EditorFor field. My code for the view is: <div class="editor-label"> @Html.Label("birthDate","birthDate") </div> <div class="editor-field"> @Htm...
Mccormac asked 2/7, 2013 at 13:39

2

Solved

It is possibly a mistake in my syntax, but I have been unable to set a default value for my EditorFor in my view using ViewBag. I have checked that the value in the ViewBag.FirstName is being pass...
Schmeltzer asked 25/8, 2015 at 21:51

4

Solved

I'm trying to create an EditorFor() for a List of a Complex Type. Specifically the "Options" below should get displayed in a one multitext input where each option(string) is in a new line. However,...
Spurt asked 29/11, 2013 at 4:27

4

Solved

Given this model, is it possible to use the Html.EditorFor() to render a file upload input element to the page? I played around with the Datatype of the property FileName, and it was definitely imp...
Bausch asked 24/5, 2011 at 16:6

3

Solved

(The editor is for a DateTime property called "ADate" I am trying this but it does not work. @Html.EditorFor(model => model.ADate, new { cssClass = "date" } ) So I tried this: @Html.TextBox...
Selective asked 10/12, 2013 at 2:41

3

Solved

this may be kind of general but i want to limit the number of character inpit in an editorfor field. @html.EditorFor(m=>m.id,new {@maxlength="10"}) This does not seem to work.
Icelander asked 28/5, 2012 at 12:16

6

I have a BookCreateModel which consists of book's plane info such as Title, PublishYear & etc plus a collection of book Authors (complex type) : public class BookCreateModel { public string T...
Viscera asked 9/7, 2012 at 21:27

14

Solved

Why can't I pass in html attributes to EditorFor()? eg; <%= Html.EditorFor(model => model.Control.PeriodType, new { disabled = "disabled", readonly = "readonly" }) %> I don't want to...
Coronagraph asked 17/9, 2010 at 12:45

8

Solved

I'm using the DataType.Date attribute on my model and an EditorFor in my view. This is working fine in Internet Explorer 8 and Internet Explorer 9, but in Google Chrome it is sh...
Scholasticism asked 28/9, 2012 at 4:12

3

Solved

I'm currently building the Admin back-end for a website in ASP.NET MVC. In an ASP.NET MVC application, I've started using the 'EditorFor' helper method like so: <div id="content-edit" class="d...
Worthen asked 27/9, 2009 at 6:17

4

How can I set a default value in my editorboxes so that in case I don't write anything in the box it doesn't send a null value. <div class="editor-label"> @Html.Label("Description") <...
Ventilation asked 15/5, 2013 at 9:51

1

I have a lengthy form which I have broken to several parts and am using @Html.EditorFor for each section which is working great but need your thoughts on whether this approach can be improved or no...
Sharisharia asked 26/9, 2014 at 21:34

2

Solved

I'm creating a MVC-application which currently uses EditorFor to gennerate a lot of views. The whole view is basically just an EditorForModel, and it works great. However, I've reached one small pr...
Hysteric asked 12/11, 2010 at 2:22

1

Solved

How to display the model decimal field with 3 decimal places. Currently it shortens it to 2 digits. 1,237 currently will be displayed as 1,24 ;)
Backflow asked 26/4, 2013 at 9:8

2

Solved

I have this class public class Contact { public int Id { get; set; } public string ContaSurname { get; set; } public string ContaFirstname { get; set; } // and other properties... } And I wa...
Ingot asked 1/10, 2012 at 14:53

2

Solved

I have a model class called Events and a model class called EventRange: public class Event { public int Id { get; set; } public string Name { get; set; } public string Description { get; set; }...
Weekend asked 16/11, 2012 at 16:42

4

Solved

I'm just learning C# and MVC, and trying to understand some examples. @Html.EditorFor(m => m) Eventually I figured out that '=>' is the lambda operator, and that it means something like "m su...
Cingulum asked 6/5, 2012 at 0:15

1

Solved

Currently I am using a Html.EditorFor control in a default 'Create' View page like this. <%: Html.EditorFor(model => model.IsActive) %> I would like to convert this to a drop down wit...
Delcine asked 1/3, 2012 at 14:8

2

Solved

I'm new from WebForms to MVC 3 and have an issue with the @Html.EditorFor() helper method. I have a strongly typed view that represents data from a database, and one of the methods is of type bool...
Fillander asked 12/12, 2011 at 15:56

1

Solved

i'm having a strange issue regarding the editorFor helper from MVC3. Here's the thing: i'm trying to display a checkboxList and it works if i don't call explicity the template name. However if i tr...
Provisional asked 22/11, 2011 at 14:13

2

Solved

I am working with razor view engine in asp.net mvc3. Now, I need an input for a DateTime which should display the value in a fixed format (say dd-MMM-yyyy). So I can do: [DisplayFormat(ApplyForma...
Hypocycloid asked 11/11, 2011 at 3:25

2

Solved

I am new to MVC3. I have a submit button on a form and I want to bind a model which has 2-3 nested object models with many properties inside. Is there a way to bind these nested objects without u...

© 2022 - 2024 — McMap. All rights reserved.