html-helper Questions

11

Solved

Is it possible when using Html.TextBoxFor to override the name attribute? I have tried with no success. I need to use TextBoxFor to get client side validation to work, however for reasons I won't ...
Argueta asked 19/5, 2011 at 11:23

3

Solved

I have a view with a model of type List<string> and I want to place a drop down list on the page that contains all strings from the list as items in the drop down. I am new to MVC, how would ...
Laurinda asked 16/4, 2011 at 19:15

1

I have two method helper with theses signatures: @helper CreateNavigation(int parentId, int depthNavigation) @helper Navigation(int parentId, int depthNavigation) I have tried to convert i...
Yemen asked 11/1, 2018 at 15:53

2

Solved

Ok, I cant find the answer to this: <%: Html.ActionLink("Click Here", "Action", null, new {class="myClass"})%> I want to set the CSS class attribute of the generated element. Obviously, ...
Titograd asked 22/9, 2010 at 5:11

5

Solved

How can I add inline html elements inside a label with Html.Label?
Namedropping asked 18/4, 2011 at 17:50

4

Solved

1) while editing a view with the row: @Html.TextArea(name: "Message", rows: 10, columns: 40) I'm getting this error at compile time: ERR: "The best overload for 'TextArea' does not have a par...
Lachrymator asked 7/3, 2013 at 16:54

4

Solved

I am working on a project where I need to output a few hundred properties on to the screen. To save myself lots of tedious markup, I decided to use reflection. //markup removed to keep this concis...
Oxford asked 27/3, 2014 at 11:2

3

Solved

I am rendering a drop down list box using my enums and I only have 3 options, but for some reason it is displaying four. The top and default option is simply blank/empty and I want this removed. I ...
Darmstadt asked 22/3, 2016 at 15:10

2

Solved

I have the following code in my .cshtml: @Html.TextArea("txtComments", new { style = "width: 450px;", placeholder = "Enter Comments here" }) But the placeholder is not displaying at all. Am I m...
Fad asked 22/2, 2013 at 9:50

7

Solved

@Html.HiddenFor(model => model.title, new { id= "natureOfVisitField", @value = '@Model.title'}) it doesen't work! how to set the value?
Stefaniastefanie asked 3/9, 2012 at 13:49

7

Solved

If I have an HTML helper like so: Name:<br /> <%=Html.TextBox("txtName",20) %><br /> How do I apply a CSS class to it? Do I have to wrap it in a span? Or do I need to somehow u...
Michelle asked 2/9, 2008 at 22:21

5

Solved

I have the following Action method, which have a viewBag with a list of strings:- public ActionResult Login(string returnUrl) { List<string> domains = new List<string>(); domains.Ad...
Rowlett asked 30/1, 2014 at 17:56

2

Solved

What's the correct syntax for an HTML helper (in MVC2) to define an onblur handler where the textbox is generated with code like: <%=Html.TextBox( "ChooseOptions.AddCount" + order.ID, (order....
Luella asked 8/5, 2010 at 17:52

5

Solved

I am using Kendo Autocomplete, In that I am filling the Text and also using that text parse data, But I want to use ID as Value to send it on server side on Form Submit. I am using this Kendo Edit...

4

Solved

I have written a basic HtmlHelper. Here's a test I wrote that simplifies what I was doing and to provide self assurance that it is happening when I use StringBuilder and TagBuilder objects: public...
Inquisitionist asked 5/8, 2011 at 2:53

3

Solved

New to MVC and have been running through the tutorials on the asp.net website. They include an example of a custom html helper to truncate long text displayed in a table. Just wondering what ot...
Greatgrandaunt asked 26/1, 2011 at 13:0

3

I have a radio button list like this: <%=Html.RadioButtonFor(m => m.Gender,"Male")%> I want this button selected by default. How do I do this?
Hanes asked 30/6, 2010 at 12:52

7

Solved

How do I create a readonly textbox in ASP.NET MVC3 with the Razor view engine? Is there an HTMLHelper method available to do that? Something like the following? @Html.ReadOnlyTextBoxFor(m => ...
Porcupine asked 6/1, 2012 at 17:13

4

Solved

I have some doubts about how to concatenate MvcHtmlString instances because of this information found in MSDN : MvcHtmlString Class Represents an HTML-encoded string that should not be encoded ...
Twig asked 11/8, 2010 at 16:49

2

Solved

Is there a way to get an @Html.DisplayFor value to show "NULL" in the view if the value of the model item is null? Here's an example of an item in my Details view that I'm working on currently. Ri...
Aguedaaguero asked 12/4, 2013 at 22:4

3

Solved

I have a asp.net mvc view that allows the user to enter some description in a textarea. There are two problems that I am facing. Either when I expand the textarea it is expanding without moving ...
Delay asked 5/5, 2011 at 5:46

5

Solved

In razor engine I have used LabelFor helper method to display the name But the display name is seems to be not good to display. so i need to change my display name how to do it.... @Html.LabelFor...
Moye asked 25/7, 2012 at 13:49

4

Solved

By default Html.ValidationSummary() produces HTML like this: <span class="validation-summary-errors">There were some errors...</span> <ul class="validation-summary-errors"> <...
Residentiary asked 2/6, 2009 at 15:52

3

Solved

This Question is similar but the accepted answer solves it server side, I'm interested in client side solutions. Given this ViewModel public class MyViewModel { public string ID { get; set; } ...
Yorkist asked 19/10, 2011 at 22:24

1

Solved

I have a weird case and I wanted your enlightenment. I have two controllers. One Person Controller for general Person use action methods and one Candidate Controller for more specific action method...
Greybeard asked 5/10, 2017 at 14:31

© 2022 - 2024 — McMap. All rights reserved.