I'm trying to pass a value from Controller to View , here's how it's in View:
<div class="alert alert-danger alert-dismissable" role="alert" id="alerta">
<button type="button" class="close" data-dismiss="alert" aria-l...
I have a viewbag, and wanted to display dates of at most 1 day before the current day, I made the code below, but without success, what alternative would I have?
if (item.DataHora < DateTime.Now - 1)
{
//codigo
}
These are my ViewData in controller:
public ActionResult Acao()
{
RupturaEntities db = new RupturaEntities();
var _listaUnidade = Enumerable.Empty<object>();
var _listaFamilia = Enumerable.E...
I have the following field that returns me the date as follows: 09/17/2018 11:52 AM
How to put it within the default pt. I already tried to put .ToString("dd/MM//yyyy") in model.dtProtoclo but it did not work.
<div class="f...
I'm doing a login screen in ASP.NET MVC. The framework makes all processes complete without errors: go to the database, query the login and return with an OK (user exists, I can authenticate). When the flow returns from the bank and passes throu...
It is giving error when starting the query and in the generation of the list with the results:
Error:
System.InvalidOperationException: The model item passed into the dictionary is of type 'System.Linq.Enumerable + WhereSelectEnumerable...
I have a Model field
[Column("sdt_dataPagamento")]
[Display(Name = "Dt. Pagamento")]
[DataType(DataType.Date)]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
public DateTime? DataPagamento { get; set; }
I...
Has anyone ever had an error like this?
View Index Code:
@model SPTC.NIE.SPG.Application.ViewModels.UsuarioViewModel
@{
ViewBag.Title = "Index";
}
<h2>Index</h2>
<p>
@Html.ActionLink("Create New", "Create")
&...
Let's suppose I want to register an item in my database. Knowing my item name and price. But I want to also when registering the item should also register the date. How do I do this? I am still new to Asp.net Mvc
MODEL
public class TABLE...