asp.net mvc

15
Search for articles, questions, tips Q&A forums lounge Rate this: Muchiachio, 13 Apr 2015 MIT ASP.NET MVC.Template introduction MVC.Template is a starter template for ASP.NET MVC based solutions Introduction As the name implies, it's a project starter template for ASP.NET MVC based solutions ﴾mainly for multi‐ paged enteprise solutions, which could change in the future if there will be need for it﴿. This project was born after working on maintaining and improving few MVC projects and seeing how much of a headache these projects were bringing with them. All because of a bad project foundation, which in the long run started to ruin program's design and maintainability even more and more. Even though there are a lot of examples of good ASP.NET MVC practises on the web, collecting them all and applying in the first applications is not an easy task. Background There are few rules this project will try to follow: Simplicity ‐ a good indicator of any program is it's simplicity thus resulting in lack of code. Any new ideas or findings on making code simplier to understand and use will be incorporated first. Hard to understand code should be reported to the issue police at GitHub along with reasoning on why it was hard to understand and use ﴾suggestions are welcome in the comments﴿. Activity ‐ by now there are a lot of good projects which are no longer actively developed ﴾dead﴿. And it is very sad. MVC.Template will try to be in the loop for years to come. Open ‐ this project will always be open sourced with MIT license. Use it, like it, hate it, do whatever. Up to date ‐ any new releases of frameworks used in the project will always be updated to their newest releases. So even though we all love MVC5, it will not be supported after vNext release will be sufficient to replace it and so on. Features Model‐View‐ViewModel architectural design. Lowercase or normal ASP.NET urls. Custom membership providers. 4.81 ﴾45 votes﴿ 11,523,229 members ﴾74,407 online﴿ Sign in × Sign up for our free weekly Web Developer Newsletter. articles

Upload: vikas-thakur

Post on 07-Dec-2015

24 views

Category:

Documents


2 download

DESCRIPTION

MVC 4.0

TRANSCRIPT

Page 1: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 1/15

Search for articles, questions, tipsQ&A forums lounge

Rate this:Muchiachio, 13 Apr 2015 MIT

ASP.NET MVC.Template introduction

MVC.Template is a starter template for ASP.NET MVC based solutions

Introduction        As the name implies, it's a project starter template for ASP.NET MVC based solutions ﴾mainly for multi‐paged enteprise solutions, which could change in the future if there will be need for it﴿.        This project was born after working on maintaining and improving few MVC projects and seeing howmuch of a headache these projects were bringing with them. All because of a bad project foundation,which in the long run started to ruin program's design and maintainability even more and more. Eventhough there are a lot of examples of good ASP.NET MVC practises on the web, collecting them all andapplying in the first applications is not an easy task.

BackgroundThere are few rules this project will try to follow:

Simplicity ‐ a good indicator of any program is it's simplicity thus resulting in lack of code. Any newideas or findings on making code simplier to understand and use will be incorporated first. Hard tounderstand code should be reported to the issue police at GitHub along with reasoning on why itwas hard to understand and use ﴾suggestions are welcome in the comments﴿.Activity ‐ by now there are a lot of good projects which are no longer actively developed ﴾dead﴿.And it is very sad. MVC.Template will try to be in the loop for years to come.Open ‐ this project will always be open sourced with MIT license. Use it, like it, hate it, do whatever.Up to date ‐ any new releases of frameworks used in the project will always be updated to theirnewest releases. So even though we all love MVC5, it will not be supported after vNext release willbe sufficient to replace it and so on.

FeaturesModel‐View‐ViewModel architectural design.Lowercase or normal ASP.NET urls.Custom membership providers.

   4.81 ﴾45 votes﴿

11,523,229 members ﴾74,407 online﴿ Sign in

×Sign up for our free weekly Web Developer Newsletter.

articles

Page 2: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 2/15

Protection from CSRF, XSS, etc.Easy project renaming.Dependency injection.Custom error pages.Globalization.Audit log.Site map.Tests.

Project structureMvcTemplate ‐ is used for keeping any project specific implementation, which can not reside inother projects. Mainly it will be custom project components, which can not be easily reused becauseof hard dependencies to other solution projects, like data access layer.MvcTemplate.Components ‐ should only contain reusable components. It means no references toany MvcTemplate.Xxxxx project, with an exception of MvcTemplate.Resources. This assembly isintented to keep all the reusable "goodies" which are born while implementing a specific project. Sothat it can be reused in the next projects and save us some more time for programming moreinteresting code.MvcTemplate.Controllers ‐ separates controllers and their routing configuration from otherassemblies. It's known that separation of controllers has some disadvantages ﴾like not being able togenerate strongly typed helpers with T4MVC﴿. But until someone proves this approach wrong,controllers will be separated.MvcTemplate.Data ‐ hides data access layer implementation from other assemblies. So thatassemblies which are using data access layer would not have to reference frameworks likeEntityFramework. Or, know implementation details about domain model mappings with viewmodels.MvcTemplate.Objects ‐ contains all domain and view model classes in one place. Any other classesshould not be here.MvcTemplate.Resources ‐ keeps all our "beloved magic strings" in healthy environment. It is alsoused for easy solution globalization.MvcTemplate.Services ‐ is the assembly which does the main job. And by the main job I meanmanaging program state, like creating, editing, deleting domain entities; sending emails; eating CPUcycles and what not. This is where the processing logic should be, not in the controller. Controllersshould only act as a brainless routing switch based on services and validation outputs.MvcTemplate.Tests ‐ yet another main reason why MVC applications become as bad as they are.One of the main problem MVC architecture is trying to address is testability, and not testing MVCapplication should be considered a sin. This assembly covers most ﴾~99%﴿ of the solution asembliescode base. Mainly through unit testing.MvcTemplate.Validators ‐ separates all domain validation logic from controllers and their services.So it can be reused in other controllers if needed ﴾e.g. account registration and profile update sharessame validation concepts﴿.MvcTemplate.Web ‐ and finally web assembly, which is kind of empty. Because it mainly consists ofUI representation views, styling sheets, scripts and other client side components.

InstallationDownload one of the release versions from GitHub, or clone develop branch to your computer.Before opening the project run "RenameProject.exe" located in the project's root folder ﴾running it

Page 3: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 3/15

later can cause some compilation problems, because of generated dll's and such﴿. It will:

Set initial assembly version to 0.1.0.0.Rename solution and projects.Rename root namespace.Rename company name.

It will ask for your desired root namespace and company's name. So entering project's rootnamespace "Oyster" and company's name "Tegram". Would result in project structure like this:

Namespaces like:Hide   Copy Code

namespace Oyster.Controllers.Administrationnamespace Oyster.Servicesnamespace Oyster.Objects

And company name will be visible in assembly declarations:

Next, open solution and build project but not run it, so that NuGet packages can be restored.After NuGet packages are restored, open Package Manager Console and run "update‐database", onData project. This creates initial database in local SQLEXPRESS instance.Project uses some of commonly used VS extensions, you should download them if you don't havethem already:

Web Essentials 201X ‐ css files are generated by using "Web Essentials" build in lesscompiler. Other then that Web Essentials provides other good VS extensions for modern webdevelopers.You may have already seen a lot of red text in "Package Manager Console", especially thosewho are using VS2013. It comes from T4Scaffolding not fully supporting VS2013.

If you are using VS2012, change T4Scaffolding.Core version to 1.0.0.If you are using VS2013, download and install Windows Management Framework 4.0.Which is needed for VS2013 scaffolding to work.

Page 4: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 4/15

Depending on your machine configuration you may need to enable powershell scriptsto be run on your machine by using "Set‐ExecutionPolicy" command.

After all this your project should compile and run. Default admin username and password can befound in EntityFramework configuration class under ~/Rootnamespace/Data/Migrations/Configuration.cs.

Using the code

Models        As you might know in traditional MVC, models are the ones to hold all business logic. But in thistemplate they are just POCOs for representing database tables. The same applies to representation modelsalso known as view models.

Hide   Copy Code

public class Account : BaseModel // All domain models should inherit base model with shared Id and CreationDate columns{    [Required]    [StringLength(128)]    [Index(IsUnique = true)]  public String Username { get; set; } // Only member declarations, no business logic

    [Required]    public Boolean IsAdmin { get; set; }}

public class AccountView : BaseView // All view models should inherit base view with shared Id and CreationDate columns{    [Required]    [StringLength(128)]    [Index(IsUnique = true)]  public String Username { get; set; } // Only member declarations, no business logic

    // Declaring only user visible fields. So that "IsAdmin" property can not be edited or over‐posted by the user}

Database        Registering newly created model with the database is relatively easy. First of all, new DbSet has to beadded to the main Context class:

Hide   Copy Code

public class Context : DBContext{    ...

    protected DbSet<Account> Accounts { get; set; } // protected is used, so that testing context can inherit the same database structure        ...}

MVC.Template is using code first approach for database management, so after adding new DbSet to thecontext you will need to run "Add‐Migration <your_migration_name>", followed by "update‐

Page 5: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 5/15

database" command in "Package Manager Console".

Another thing needed to be done in database layer is to create a map between domain and view modelsusing AutoMapper. In most cases it's just writing two lines of code in ObjectMapper class, you can alwayscheck out AutoMapper's documentation for more:

Hide   Copy Code

public static class ObjectMapper{    ...

    public static void Map()    {        Mapper.CreateMap<Account, AccountView>(); // Creating automatic map from account model to account view        Mapper.CreateMap<AccountView, Account>(); // Creating automatic map from account view to account model    }

    ...}

ControllersAny new controller should inherit BaseController, which can be used as an extension point for everycontroller. Also it keeps shared controller methods, like authorization and redirection to static pages ﴾e.g."404 not found", "403 unauthorized"﴿. Other controller bases include:

ServicedController ‐ for controllers with injected service instance,ValidatedController ‐ for controllers with injected service and validator instances.

The one to choose should be obvious from your needs in a controller. All these controller bases are under[GlobalizedAuthorize] attribute, so they will all be authorized by default.

Hide   Copy Code

public class AccountsController : ValidatedController<IAccountValidator, IAccountService> // Using ValidatedController, because contoller will be using validator and service instances{    ...

    [HttpGet]    public ActionResult Edit(String id)    {        return NotEmptyView(Service.Get<AccountView>(id)); // Getting view from service, and returning account view only if account with given id still exists, otherwise redirecting to not found page.    }

    [HttpPost]    [ValidateAntiForgeryToken] // Validate antiforgery token on all post actions    public ActionResult Edit(AccountView account) // Action accepting AccountView class from the request    {        if (!Validator.CanEdit(account)) // One call to validate everything about the model            return View(account); // Return to same model view, if any validation failed

        Service.Edit(account); // Otherwise perform model mutation by using the service

        return RedirectIfAuthorized("Index"); // Redirecting to "Index" action, only then current user is authorized to view it, otherwise redirect to home page    }

    ...

Page 6: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 6/15

}

Services    Services are ment to keep business logic for changing domain model or doing other business tasks. Oneservice class should only "serve" one domain model, thus the name of the service should generally be<Domain model name>Service ﴾e.g. AccountService, RoleService﴿. In addition to that, every service shouldhave an interface which inherits IService.

Hide   Shrink   Copy Code

public interface IAccountService : IService // Inheriting shared service interface{    ...

    TView Get<TView>(String id) where TView : BaseView; // Defining generic GetView method, so that account model can be automatically mapped to any mapped view

    void Edit(AccountView view); // Defining edit action for account view

    ...}

public AccountService : IAccountService{    ...

    public TView Get<TView>(String id) where TView : BaseView    {        return UnitOfWork.GetAs<Account, TView>(id); // Getting account domain model with given id from the database, and mapping it to TView type    }

    public void Edit(AcountView view)    {        Account account = UnitOfWork.To<Account>(view); // Mapping view back to model

        UnitOfWork.Update(account); // Updating account        UnitOfWork.Commit(); // Commiting transaction    }

    ...}

Validators    Validators, unlike services are ment to hold all business validation logic for domain models. Validatorimplementation follow the same pattern as services. Validation class for one domain model with validatorinterface.

Hide   Copy Code

public interface IAccountValidator : IValidator // Inheriting shared validator interface{    // Other account validator interface code

    Boolean CanEdit(AccountView view); // Defining needed validation methods for account view

    // Other account validator interface code}

public AccountValidator : IAccountValidator{    ...

Page 7: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 7/15

    public Boolean CanEdit(AcountView view)    {        Boolean isValid = IsUniqueUsername(view); // Making any custom validation to the view        isValid &= ModelState.IsValid; // Always include ModelState validation check, so that controller never has to call ModelState.IsValid

        return isValid;    }

    ...}

Views    Views should always be written for view models like "AccountView", "RoleView", but never for domainmodels.

Hide   Shrink   Copy Code

@model AccountEditView

<div class="widget‐box">    <div class="widget‐title">        <span class="widget‐title‐icon fa fa‐th‐list"></span>        <h5>@Headers.AdministrationAccountsEdit</h5>    </div>    <div class="widget‐content">        @using (Html.BeginForm())        {            @Html.AntiForgeryToken() @* Validating anti forgery token on all post actions. *@            <div class="form‐group">                <div class="control‐label col‐sm‐12 col‐md‐3 col‐lg‐2">                    @Html.FormLabelFor(model => model.Username) @* Custom label helper to add required '*' spans and localizing labels. *@                </div>                <div class="control‐content col‐sm‐12 col‐md‐9 col‐lg‐5">                    @Html.FormTextBoxFor(model => model.Username) @* Custom text box helper to add necessary attributes, like readonly on not editable fields. *@                </div>                <div class="control‐validation col‐sm‐12 col‐md‐12 col‐lg‐5">                    @Html.ValidationMessageFor(model => model.Username)                </div>            </div>            <div class="form‐group">                <div class="form‐actions col‐sm‐12 col‐md‐12 col‐lg‐7">                    <input class="btn btn‐primary" type="submit" value="@Actions.Submit" />                </div>            </div>        }    </div></div>

Globalization    Currently default language is English, in addition to that Lithuanian was added, just for an example ofmultiple languages with different number and date formats in the system. You can easily disable Lithuanianlanguage by removing it from the Globalization.xml file ﴾and then you have time, removing it's resources orreplacing them with your language of choice﴿.

Hide   Copy Code

<?xml version="1.0" encoding="utf‐8" ?><globalization>    <language name="English" culture="en‐GB" abbrevation="en" default="true" />

Page 8: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 8/15

MuchiachioSoftware Developer NonFactors Niue

No Biography provided

</globalization>

Leaving one language will remove any language selections in the system automatically.

Summary        In this article, I introduced you to MVC.Template, a starting project template for ASP.NET MVC basedsolutions. And explained starting project structure, it's installation and basic code usage. More examplescan always be found in MVC.Template's codebase at GitHub. This project will be actively develop by meand my colleagues at work. And hopefully become ASP.NET MVC project starting point for new andexperienced developers alike.

History2015.04.12 Updates, accordingly with v1.3.

2015.01.05 Updates, accordingly with v1.2.

2014.11.09 Updates, accordingly with v1.1.

2014.09.22 Initial article for v1.0

LicenseThis article, along with any associated source code and files, is licensed under The MIT License

Share

About the Author

EMAIL

Page 9: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 9/15

Search Comments   Go

 

Comments and Discussions

You must Sign In to use this message board.

First Prev Next

can't do update‐dabase in VS2015

Sign In · View Thread · Permalink

How can this template handle the need to read legacy data ?without breaking it's own elegance and rationale ! Step by step instructions needed if possible.Thanks

Sign In · View Thread · Permalink

Any tips on how to wire‐upHide   Copy Code

Microsoft.Owin.Security

as AuthenticationProvider instead of your BaseController Impl?Hide   Copy Code

RegisterInstance<IAuthorizationProvider>(new AuthorizationProvider(typeof(BaseController).Assembly));

Thanks!

Sign In · View Thread · Permalink

about update‐dabase dennyqiu 9‐Jun‐15 3:52

Re: about update‐dabase Muchiachio 3hrs 25mins ago

legacy ﴾oracle﴿ data zpaulo_carraca 17‐May‐15 23:54

Re: legacy ﴾oracle﴿ data Muchiachio 18‐May‐15 3:52

Microsoft.Owin.Security rghubert 16‐May‐15 10:17

Re: Microsoft.Owin.Security Muchiachio 16‐May‐15 22:59

Re: Microsoft.Owin.Security

Page 10: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 10/15

Hello muchiachio.Could you tell me how I can incorporate icons in the application ﴾siteMap, datagrids, forms, etc.﴿ Iam trying to follow the pattern that you have used but I cannot get the new icons to appear in theapplication. Except all that you’ve used previously in Administration area.Is it possible that I have to download them and put them in a folder like it is done with the countryflags for localization of the application? Or do I have to make some reference anywhere in theproject?Once again thank you very much for your kindness in sharing with us this great job and for givingus a first class customer service without charging anything for it.

Hide   Copy Code

<siteMapNode menu="true" icon="fa fa‐user" area="Medico" controler="Antecedentes" action="Index">  <siteMapNode icon="fa fa‐user" area="Medico" controler="Antecedentes" action="Create"/>  <siteMapNode icon="fa fa‐user" area="Medico" controler="Antecedentes" action="Details"/>  <siteMapNode icon="fa fa‐user" area="Medico" controler="Antecedentes" action="Edit"/>  <siteMapNode icon="fa fa‐user" area="Medico" controler="Antecedentes" action="Delete"/></siteMapNode>

AF Matambo

Sign In · View Thread · Permalink

Great. Thanks for sharing and supporting this project.

Sign In · View Thread · Permalink

Hi,thanks for your great template, I love using it.I am using VS 2013, and can't get the scaffolding to work. When I add a view, the default templateseems to be used, also I can't find a way to add a new controller using scaffolding.Can you help me?

Sign In · View Thread · Permalink

rghubert 17‐May‐15 3:24

Re: Microsoft.Owin.Security Muchiachio 17‐May‐15 3:29

How to put icons in the aplication AFMatambo 6‐May‐15 15:06

Re: How to put icons in the aplication Muchiachio 6‐May‐15 19:01

Re: How to put icons in the aplication AFMatambo 7‐May‐15 3:02

My vote of 5 Vangel Kolarov 6‐May‐15 1:26

Scaffolding hahajoop 3‐May‐15 20:16

Page 11: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 11/15

Who can explain precisely what is happening here,  

Hide   Copy Code

IEnumerable<String> errorMessages = ViewData.ModelState.SelectMany(state => state.Value.Errors).Select(error => error.ErrorMessage);    AlertsContainer alerts = TempData["Alerts"] as AlertsContainer;

and above all, where the error messages come from. It looks like this is populated by theHtmlExtensions somehow but still not clear. Any tips? Thanks!

Sign In · View Thread · Permalink

Hi, thanks for the update. What is the pattern for adding a WebApi. Since BaseController is aController and not an ApiController...?

Sign In · View Thread · Permalink

Today it is fashionable the use of async and await to improve application performance according toMicrosoft recomendations. Is it possible to use this technology with this template? If so, can youexplain to beginners how to use it without breaking functionality that already exists in thistemplate? I'll need to implement it in the T4 template so that new Controllers have it in place, I'll appreciate ifyou implement it also in the T4 Code Templates.Thank you very much.

AF Matambo

Sign In · View Thread · Permalink

Re: Scaffolding Muchiachio 4‐May‐15 4:02

Re: Scaffolding hahajoop 4‐May‐15 9:23

Views/Auth/_AuthAlerts.cshtml line 1! rghubert 21‐Apr‐15 10:10

Re: Views/Auth/_AuthAlerts.cshtml line 1! Muchiachio 22‐Apr‐15 4:10

Re: Views/Auth/_AuthAlerts.cshtml line 1! rghubert 22‐Apr‐15 10:32

Best‐Practice for adding a WebApi rghubert 15‐Apr‐15 2:47

Re: Best‐Practice for adding a WebApi Muchiachio 15‐Apr‐15 5:18

how to implement the async and await in this template AFMatambo 19‐Mar‐15 9:17

Page 12: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 12/15

it would be nice to put the translations on the database

Sign In · View Thread · Permalink

Hi,

in order to make a DB migration to SQL Azure possible, it would be good if the primary keys weredeclared as clustered indexes. Otherwise, the following errors arise upon migration. I changed themto clustered indexes and the import works now ﴾and hopefully the application too!﴿.

Thanks!

Hide   Copy Code

One or more unsupported elements were found in the schema used as part of a data package.Error SQL71564: Table Table: [dbo].[Accounts] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.Error SQL71564: Table Table: [dbo].[Roles] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.Error SQL71564: Table Table: [dbo].[RolePrivileges] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.Error SQL71564: Table Table: [dbo].[Privileges] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.Error SQL71564: Table Table: [dbo].[Logs] does not have a clustered index.  Clustered indexes are required for inserting data in this version of SQL Server.

Re: how to implement the async and await in this template Muchiachio 19‐Mar‐15 20:47

Re: how to implement the async and await in this template AFMatambo 22‐Mar‐15 12:57

Localization on db Z@clarco 18‐Mar‐15 3:42

Re: Localization on db Muchiachio 18‐Mar‐15 4:36

Re: Localization on db Z@clarco 18‐Mar‐15 5:00

Re: Localization on db Z@clarco 18‐Mar‐15 5:03

Re: Localization on db Muchiachio 18‐Mar‐15 5:25

Re: Localization on db Z@clarco 18‐Mar‐15 22:06

Re: Localization on db Muchiachio 19‐Mar‐15 1:30

Re: Localization on db Z@clarco 19‐Mar‐15 2:57

Re: Localization on db Z@clarco 24‐Mar‐15 3:50

Re: Localization on db Muchiachio 24‐Mar‐15 5:32

Suggestion: primary keys with clustered indexes rghubert 7‐Mar‐15 5:54

Page 13: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 13/15

 (Microsoft.SqlServer.Dac)

Sign In · View Thread · Permalink

Hey there, may cordial greeting.

After cloning the last commit of the template and rename it, I 'm getting an error that I do not knowhow to solve it. “An error occurred while trying to restores packages: Unable to find version 1.0.1 ofpackage CampanyName.Grid.Core.Mvc5 ", Visual Studio suggest to restores the package but doingso is resulting in same error.

I don’t know if it is being caused by renaming the application of the solution, maybe after that it isnot pointing to the correct name space, all the solution components are loading correctly. I tried touse Nuget Install‐Package Mvc.Grid command it is not recognized and is not working. Can you helpme with this issue?

Thank you so much, have a nice day.

AF Matambo

Sign In · View Thread · Permalink

It's just perfect for starting a new project! Very good job!I would like to use your template but I was wondering why you didn't use Identity2.0 and the builtinrole Model?Thanks again for this great template!Kind Regards,

Sign In · View Thread · Permalink

Re: Suggestion: primary keys with clustered indexes Muchiachio 7‐Mar‐15 6:07

Re: Suggestion: primary keys with clustered indexes rghubert 19‐Mar‐15 4:41

Mvc.Grid is not loading and Unable to restore it in the solution AFMatambo 22‐Feb‐15 15:36

Re: Mvc.Grid is not loading and Unable to restore it in the solution Muchiachio 22‐Feb‐15 19:20

Re: Mvc.Grid is not loading and Unable to restore it in the solution AFMatambo 9‐Mar‐15 9:26

Indentity 2.0 Member 11439245 9‐Feb‐15 5:11

Re: Indentity 2.0 Muchiachio 9‐Feb‐15 5:29

Re: Indentity 2.0 Member 11439245 9‐Feb‐15 21:54

Page 14: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 14/15

In the business world, even in small ones, the management of user accounts is made by anadministrator at the request of the head of human resources in such a way that when an employeesign a new contract then the admin opens new account and when the contract ends thecorresponding account is closed, may be using ﴾Delete or blocking﴿ procedure, preferably the betterand cautious way is blocking the access to the system for preventing a cascading deletion ofimportant business data that an employee has created .

It would be great and extremely useful to be maintained in this template this scenario of creationand account lockout, and when the user login verify not only the account existence but also thatthis user is enabled for system access.

On one occasion I saw a Boolean property, concerning the verification of a user account if it isactive or not, currently I don’t see it implemented. Forgive me if this scenario is alreadyimplemented in some way and I am not being able to see in what way is it implemented. If this is acase please, I would appreciate that you tell me how I can apply it.

If it is not implemented we would greatly appreciate an implementation in this regard in the nextreleases.

In same way it is needed to force the password expiration and allow change every 90 or 180 daysfor example, and if the accounts password expired without password change lockout the account.Also is needed to limit the login intents to 3 ‐ 5 for example, and after that, deny the accountAccess to system until it is enabled by the Sys Admin User.

Please can you add this functionalities in the next future?

Sincerely thank you very much for helping us mostly for who comes from Windows Form world andget in touch for first time with MVC technology.

Once again thank you.

AF Matambo

modified 19‐Jan‐15 0:59am.

Sign In · View Thread · Permalink

Re: Indentity 2.0 Muchiachio 9‐Feb‐15 22:47

Re: Indentity 2.0 Member 11439245 9‐Feb‐15 23:22

User Account ﴾Creation, Registering and Blocking﴿ by Sys_Admin needed implementation[modified] AFMatambo 18‐Jan‐15 18:03

Re: User Account ﴾Creation, Registering and Blocking﴿ by Sys_Admin needed implementation

Muchiachio 19‐Jan‐15 6:23

Re: User Account ﴾Creation, Registering and Blocking﴿ by Sys_Admin neededimplementation

Page 15: ASP.NET MVC

6/11/2015 ASP.NET MVC.Template introduction  CodeProject

http://www.codeproject.com/Articles/820836/ASPNETMVCTemplateintroduction 15/15

Permalink | Advertise | Privacy | Terms of Use | Mobile Web04 | 2.8.150604.1 | Last Updated 13 Apr 2015 Select Language ▼

Article Copyright 2014 by MuchiachioEverything else Copyright © CodeProject, 1999‐2015

Layout: fixed | fluid

Is it possible to Localize the strings of the options of grid filter ﴾Equals, Contains, StartsWith,EndsWith﴿?Thank you.

AF Matambo

Sign In · View Thread · Permalink

Refresh 1 2 3 Next »

General    News    Suggestion    Question    Bug    Answer    Joke    Rant    Admin   

AFMatambo 20‐Jan‐15 18:14

Localization of Grid filter optin strings AFMatambo 16‐Jan‐15 23:37

Re: Localization of Grid filter optin strings Muchiachio 16‐Jan‐15 23:41

Re: Localization of Grid filter optin strings AFMatambo 17‐Jan‐15 0:50