martes, 23 de mayo de 2017

MVC Post Action Method is calling when using @Html.Action

MVC Post Action Method is calling when using @Html.Action

Please follow up the steps below to solve the issue:

1. Avoid using @Html.Action from the Layout page (shared folder)
2. If you are using Ajax calls with the POST method inside the main page, please be sure the assigned Url has a valid value, otherwise the system will load again the same page but with the post action, that's why when it loads the partial page inside the main page with the @Html.Action it is calling the Post Action method.

martes, 9 de mayo de 2017

Entity Framework - Have column in our model without including it to the database

Entity Framework - Have column in our model without including it to the database


Please see the sample below:

public class TheModelSample
{
    public int Id { get; set; }
    public string UserName { get; set; }

    [NotMapped]
    public string ConfirmPassword { get; set; }
}