I am trying to insert text from richtext in the database. I get this error.
The code can be injurious <p>test </p>
Somwting like that I have translate The error from Swedish. I also have HtmlAllow in the class.
public class TypeOfVehicleRecord : BaseEntity
{
public TypeOfVehicleRecord()
{
Vehicles = new List<VehicleRecord>();
}
public virtual int TypeOfVehicleId { get; set; }
[NopResourceDisplayName("Plugins.Other.Vehicle.TypeOfVehicleName")]
public virtual string TypeOfVehicleName { get; set; }
[NopResourceDisplayName("Plugins.Other.Vehicle.TypeOfVehicleAddedDate")]
public virtual string TypeOfVehicleAddedDate { get; set; }
[NopResourceDisplayName("Plugins.Other.Vehicle.TypeOfVehicleDescription")]
[AllowHtml]
public virtual string TypeOfVehicleDescription { get; set; }
[NopResourceDisplayName("Plugins.Other.Vehicle.TypeOfVehicleVehiclesName")]
public virtual List<VehicleRecord> Vehicles { get; set; }
}
public class TypeOfVehicleMap : EntityTypeConfiguration<TypeOfVehicleRecord>
{
public TypeOfVehicleMap()
{
ToTable("Vehicle_TypeOfVehicles");
HasKey(m => m.TypeOfVehicleId);
Property(m => m.TypeOfVehicleAddedDate);
Property(m => m.TypeOfVehicleDescription);
Property(m => m.TypeOfVehicleName);
}
}
[HttpPost, ParameterBasedOnFormName("save-continue", "continueEditing")]
public ActionResult Create(TypeOfVehicleRecord typeOfVehicle, bool continueEditing)
{
TypeOfVehicleRecord record = _typeOfVehicleService.GetTypeOfVehicleById(typeOfVehicle.TypeOfVehicleId);
if(record == null)
{
record.TypeOfVehicleName = typeOfVehicle.TypeOfVehicleName;
record.TypeOfVehicleDescription = typeOfVehicle.TypeOfVehicleDescription;
record.TypeOfVehicleAddedDate = DateTime.Now.ToString();
record.Id = 1;
_typeOfVehicleService.InsertTypeOfVehicle(record);
//_typeOfVehicleRepo.Insert(record);
if (continueEditing)
{
return RedirectToAction("Edit", new { id = 1 });
}
return RedirectToAction("List");
}
return View(typeOfVehicle);
}