Questions tagged as 'asp.net-mvc-5'

1
answer

How to apply DropDownListFor with bootstrap?

I have the following code: @Html.DropDownListFor(model => model.CountryId, Model.AvailableCountries, new { @class = "form-control", @readonly = true }) Result: link I want to make it look something like this: link Any solution?...
asked by 03.01.2017 / 04:02
2
answers

How to check input text before posting?

Follow the code: @using (Html.BeginForm("Update", "Account", FormMethod.Post, new { @class = "form-horizontal", role = "form", enctype = "multipart/form-data" })) { . . . <input type="text" name="lastname"> <input type="submit" class=...
asked by 03.01.2017 / 00:07
2
answers

What is the difference between public async System.Threading.Tasks.TaskActionResult Index () and public ActionResult Index ()? [duplicate]

Follow the code: Example 1: public async System.Threading.Tasks.Task<ActionResult> Index() { return View(); } Example 2: public ActionResult Index() { return View(); } Please explain the difference between the 2 in as...
asked by 07.01.2017 / 01:00
1
answer

There is no ViewData item of type 'IEnumerable' that has the key

I'm having a problem with the Employee Position that stays in a separate Table, when I try to create an employee selecting the position, it's the error ... but if I assign the position in the Controller (Ex: official.CargoID = 1) it works normal...
asked by 15.11.2016 / 23:53
1
answer

Set Value in an @ html.DropDownList

In a form for Address Book, I wanted to do the following. the guy types the zip, then fetches the zip, and returns the data to fill in the EditorFor. So good, it's working. City and States are in a separate table, and are displayed by DropDownLi...
asked by 18.11.2016 / 14:33
1
answer

Image Thumbnail through URL [closed]

I want to do this: There is a field where the user inserts the URL of an image, and wanted to paste this url into the field, a thumbnail appears next to (or below) the field, similar to what FB does, where you paste the URL url of the video i...
asked by 26.01.2017 / 22:43
1
answer

Fill in a Dropdown (Select)

I need to create a select In this pattern: <select id="Cidades"> <option></option> </select> Where the user will select his state, and then there will be a jquery that searches the cities according to the selecte...
asked by 21.11.2016 / 23:11
1
answer

Fill in a list with Json's return

I wanted to populate a textarea or anything that looks like a list, with the items the guy selects from a dropdow. So I thought so, but I do not know how to feed the list ... <textarea cols="1" id="lista"> <ul> </ul&g...
asked by 02.12.2016 / 04:06
1
answer

Join for 2 tables

How do I use the Join method to give an include of a value from another table? In this case I was going to use the MusicCall table and the MusicCount table var chamadaMusicas = db.ChamadaMusicas .Include(c => c.Chamad...
asked by 01.12.2016 / 16:19
1
answer

URL by ViewBag

I wanted to pass a URL through the ViewBag, but I could not. wanted to do asim: ViewBag.Quantidade = "Você Não tem quantidades suficientes, para continuar você deve comprar um Pacote"; in this case the text "buy a package" was a link.     
asked by 01.12.2016 / 13:34