Questions tagged as 'asp.net-mvc'

4
answers

ObjectCache to make a variable available to all users

I have an application in ASP.NET and would like to cache all users as if the variable were in the pool application and everyone had access, something other than the session that makes the section variable for each user. ObjectCache...
asked by 08.04.2015 / 15:47
3
answers

System.NullReferenceException in an attribute of type StringBuilder

What causes the error to occur? How to correct? Model: public class modelExemplo { public StringBuilder listNewsletter { get; set; } } Controller: public ActionResult funcaodeteste() { modelExemplo obj = new modelExemplo()...
asked by 25.10.2017 / 14:00
2
answers

DisplayNameFor and DisplayFor

Studying ASP.NET MVC, I came across the following lines of code: @Html.DisplayNameFor(model => model.Title) @Html.DisplayFor(model => model.Title) I can not understand the difference between using DisplayNameFor and DisplayF...
asked by 08.08.2017 / 19:21
2
answers

Receive by parameter a Varied object list

I have the following problem described in the comment: public class Funcionario{ public long Id {get; set;} public string Nome {get; set;} public DateTime DataContrato {get; set;} } public class Carro{ public long Id {get; set...
asked by 26.10.2016 / 21:26
2
answers

Person registration using multiple viewModels and only one controller

I want to register a person, which I divided into three entities: Person, Contact and Address. And I want it to be just a registration form. My action create in the person controller looks like this: [HttpPost] [ValidateAntiForgeryT...
asked by 20.07.2015 / 20:42
3
answers

How to return values from two different tables?

I'm working on an auto complete script that should search two peer tables (Courses and Packages) (unrelated) and return the merged values in a single list. The problem is that the query below is not returning any value: [HttpGet] public Js...
asked by 07.06.2016 / 20:34
2
answers

Doubt with asp.net mvc registry edition

I have the structure: Page where I select the record for editing: @if (Model.Count() > 0) { foreach (var item in Model) { <tr> <...
asked by 15.06.2016 / 02:17
3
answers

Create FTP access to a virtual directory on Azure

I have a Web Application on Azure and created an internal folder as a virtual directory for an outsourced developer to deploy a contracted system. I'm having a hard time creating an FTP that only has access to the / commercial directory within t...
asked by 07.08.2015 / 15:16
3
answers

Update to 2 tables

I can not make an update of the 2 tables. The problem is here. db.Entry(catequizando).State = EntityState.Modified; db.Entry(pessoa).State = EntityState.Modified; db.SaveChanges(); Any solution? Controller : [HttpPost] [Vali...
asked by 28.08.2015 / 18:18
1
answer

MVC - Create a typed model being a generic list

I would like to create a typed Model with it being a list of type T . Using: ASP.NET MVC 5 Razor For example: My model in cshtml will look like this: @model List<T> @foreach (var item in Model) { <h1>@item.nam...
asked by 23.06.2017 / 03:03