Tagged Questions
2
votes
0answers
43 views
Writing an MVC HtmlHelper for an IEnumerable<TModel> to display an HTML Table
I am trying to write a customer HtmlHelper that allows easy creation of an Html Table from a view being passed an IEnumerable <TModel> where TModel is a Model Object Type. I would like the ...
0
votes
0answers
4 views
SelectListItem with data-attributes
Is there anyway to have a SelectList prepopulated on ViewModel with data-attributes ?
I want to do
@Html.DropdownListFor(m=> m.CityId, Model.Cities);
so it generates code like :
<select ...
0
votes
0answers
31 views
Mocking HtmlHelper throws NullReferenceException
I know that there are a few questions on StackOverflow on this topic but I haven't been able to get any of the suggestions to work for me. I've been banging my head against this for two days now so ...
0
votes
0answers
22 views
ASP.Net Html Helpers
I want to make html helpers for the following HTML code. Dont know the correct syntax for exactly this html.
<label class="control-label">First Name</label>
<input type = "text" ...
0
votes
0answers
29 views
How to get Helpers back into needed context in BlogEngine.NET?
Trying to integrate BlogEngine.NET into an existing large and complicated .NET web site, I've found that my cshtml files cannot locate the helpers files. This is a site which has not previously made ...
0
votes
0answers
30 views
DropDownList helper doesn't see selected
My code from the View is:
@Html.DropDownList("subsidiary", (List<SelectListItem>)ViewBag.Subsidiaries, new Dictionary<string, object> { { "class", "chzn-select" }, { "style", "width: ...
0
votes
0answers
15 views
_ in the beginning of GenerateIdFromName helper gives null value
"HtmlHelper.GenerateIdFromName("_name")" gives null value . _ is not accepted as the first character. Can any one provide solution on this?
0
votes
0answers
96 views
A list I need to pass to a partial view is always null
I am building an app that needs to manage data. In my controller I have 2 lists: a list of items displayed at the screen, and a list of items that is updated each time the user adds or remove an item. ...
0
votes
0answers
63 views
unable to use html.serialize in my view(.vbhtml)
I am new to MVC, I had a requirement to show wizard steps and i was following the code explained in the below link for it. multi-step registration process issues in asp.net mvc (splitted viewmodels, ...
0
votes
0answers
137 views
Html.TextBox does not use translate DataAnnotations to unobtrusive client side validations, HtmlTextBoxFor does
Simple Model:
public class Person {
[Required(ErrorMessage = "First Name is required")]
[StringLength(50, ErrorMessage = "First Name must be less than 50 letters")]
public string ...
0
votes
0answers
72 views
Load data to a Dropdown based on the user selection of another dropdown - Logic error
@Html.DropDownListFor(mod => mod.pplId, Model.allPpl, "")
As soon as the user selects a person from the above list, i want to list the prescription numbers he/she has got in another DropDownList.
...
0
votes
0answers
142 views
MVC4 HtmlHelper custom 3 state checkbox - ideas welcome
May get downvoted for not being a 'real' question, but here goes.
I have a form in MVC4 which will contain 20+ data input fields for test results. Each result can be POS, NEG or blank. The ...
0
votes
0answers
110 views
Why does MVC3 Chart Helper show all bars but only some labels?
I am creating a chart here.
Why does MVC3 Chart Helper show all bars but only some labels?
Thanks.
From the debugger everything looks fine.
0
votes
0answers
163 views
ASP MVC 3rd party controls - use jQuery API or HTML Helpers?
Control vendors targetting ASP MVC typically ship their control libraries with both ASP MVC Html Helpers and jQuery API.
So in a simple example like a grid we have a couple of alternatives.
(I am ...
0
votes
0answers
138 views
Does the [HiddenInput] attribute work, when using @Html.EditorForModel()?
I marked the "ProductId" property with "HiddenInput" attribute:
[HiddenInput(DisplayValue = false)]
public int ProductId { get; set; }
When i use @Html.EditorForModel() in "Index" view, ...