Questions tagged as 'asp.net-mvc'

1
answer

Hybrid hosting with a single domain is possible? [closed]

I have a client that has a PHP site, but the developer told him that he could not do the database with his system. He asked me to make a system for him that had a CRUD as a client. Since he has a contract with the company that developed his site...
asked by 23.12.2016 / 03:11
1
answer

Publish Asp.NET MVC site?

I developed a site in ASP.NET MVC and now I want to post it to my provider using FTP. I've done all the FTP configuration in Publish of VS 2013 that I'm using. When you send the Controllers , Enums folders and others are not sent to the...
asked by 06.06.2017 / 17:47
2
answers

The type must be a reference type in order to use it as parameter 'TEntity' in the generic type or method 'DbSetTEntity'

I'm trying to set up an enum in ENTITY FRAMEWORK. But I'm not having success. My Context looks like this: public class MoradaWebContext : DbContext { public DbSet<MeuEnum> Status { get; set; } } The Enum looks like this: public...
asked by 16.03.2017 / 20:20
1
answer

Format query in linq to send to the ViewBag

I made a query in linq, but the result was not expected, it seems the problem is simple but I can not solve it. Result on label:    {Year = 2016/2017} Expected result on label:    2016/2017 Controller: //query var queryAn...
asked by 10.03.2016 / 20:44
1
answer

How to work with Database Views in ASP.NET MVC?

Views does not have a primary key then it generates the error:    Error: The number of primary key values passed must match number of   primary key values defined on the entity. How could you do to avoid this error? public ActionResul...
asked by 08.04.2015 / 03:41
2
answers

Prevent the user from voting on the same Post

I created a voting system, where users can give like / dislike in chapters of books posted on the site. Here is my action: public ActionResult Like(int id) { int iduser = Convert.ToInt32(Session["IDUsuario"]);...
asked by 06.11.2014 / 04:11
1
answer

Security and authorization using Roles

I am terminating my application by configuring the authorization and permission of the application users. My idea is to tinker with the layout so that the menus and submenus are only visible to those who have permission for it. According to what...
asked by 16.07.2014 / 16:34
2
answers

Put a datepicker in a mvc 5 view with jquery or similar

I have this razor in my view: <div class="form-group"> @*@Html.LabelFor(model => model.DT_AGENDAMENTO, htmlAttributes: new { @class = "control-label col-md-2" })*@ @Html.Label("Data de Agendamento", htmlAttribu...
asked by 11.11.2015 / 17:31
2
answers

Load city select after state select

I have this HTML, and I would like that when the user selects the state, it loads the data of the city of the selected state: <label asp-for="Cidade" class="col-md-1 control-label" style="text-align:left;"></label>...
asked by 04.12.2018 / 16:19
1
answer

Decimal field displays a .0 on the screen

I have a CPF field that is decimal (11). Well, when I show on the grid the CPF it looks like this: 12345678911.0, how can I remove the .0? My ViewModel public class FuncionarioViewModel { [Key] public int id { get; set;...
asked by 13.08.2018 / 20:30