MVC Standard coding
-
I'm kind of new to MVC (been programming for about 6 months), I'm looking for some help trying to learn standard coding in mvc, I already have my model and classes separate in another project but what I'm looking for is things like exception handling, standard view messages for example I have a class called returnMessage and through this I send anything I want back to my view (in ViewBag) and display it there, so if you could guide me thought or give me some articles to read that would be fantastic. Regards, Mr.K
-
I'm kind of new to MVC (been programming for about 6 months), I'm looking for some help trying to learn standard coding in mvc, I already have my model and classes separate in another project but what I'm looking for is things like exception handling, standard view messages for example I have a class called returnMessage and through this I send anything I want back to my view (in ViewBag) and display it there, so if you could guide me thought or give me some articles to read that would be fantastic. Regards, Mr.K
-
I'm kind of new to MVC (been programming for about 6 months), I'm looking for some help trying to learn standard coding in mvc, I already have my model and classes separate in another project but what I'm looking for is things like exception handling, standard view messages for example I have a class called returnMessage and through this I send anything I want back to my view (in ViewBag) and display it there, so if you could guide me thought or give me some articles to read that would be fantastic. Regards, Mr.K
My advice would be to get a book on MVC and just go through it. The ViewBag is ok, it "works" but it's not really best practice, you'll want to use models to pass data to your views as they are strongly typed and can contain the logic they need. Obviously no-one can explain all of the issues and standards to do you in a forum post which is why it's best to get a book on MVC as that should take you through everything you need to know.
-
I'm kind of new to MVC (been programming for about 6 months), I'm looking for some help trying to learn standard coding in mvc, I already have my model and classes separate in another project but what I'm looking for is things like exception handling, standard view messages for example I have a class called returnMessage and through this I send anything I want back to my view (in ViewBag) and display it there, so if you could guide me thought or give me some articles to read that would be fantastic. Regards, Mr.K
You may check coding guidelines rather than standards that will help you learn and make feasible application highlighted points are as below - DO separate the model its own project with a distinct assembly - DO put all business logic in the model. - DO put all validation logic in the model - DO define interfaces for data access - DO put all session logic in the model - DO put HTML in Views and Partial Views (not in a controller). More you can get on This link[^]
Find More .Net development tips at : .NET Tips The only reason people get lost in thought is because it's unfamiliar territory.