Has error handling in MVC changed since 2009? - asp.net-mvc-3

Google the phrase 'exception handling asp.net mvc3 Application_AcquireRequestState' leads me to:
Error Handling in ASP.NET MVC
But is the best answer of 2 years ago still the best answer? What's changed? There seems to be debate as to what methods to override in the current framework.

Honestly, it looks like a lot of the information in that question is inaccurate (some of the inaccuracies were even pointed out in some of the less voted up answers to that question) and/or outdated.
On my machine, using .NET 4, MVC 3, and IIS 7 HandleErrorAttribute and custom errors work just fine. It's possible that an earlier version of one or more of those components had a bug or something but I'm not in a position to look it up right now.

Related

The Type or namespace name "WinContols" does not exist in the namespace 'Telerik'

I picked up an Desktop Application written in ASP .NET Web Forms that has been developer 5 years ago and the person is not around. I do need to make some changes but I am stuck and getting it running. (I am using VS17)
I google the issue but unfortunately there is so little out there about it and most of them are really old.
I am missing come Telerik References. To be exact here are list of them.
I have tried this one but was not successful. I followed the steps here but got stock at adding
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft.NETFramework\AssemblyFolders\Telerik UI for WinForms Q1 2014]#="C:\Program Files\Telerik\UI for WinForms\Q1 2014\bin\"
My Telerik looks to be installed at
C:\Program Files (x86)\Progress\Telerik UI for ASP.NET AJAX R1 2019
I do not have a bin folder.
And if I go to those bin folders I don't have anything like Telerik.WinControls.****
I am not sure if it is still supported or what I am doing wrong. I have got bunch of other errors but I have a feeling that they are all related to these missing namespaces.
Any help would be much apricated.
EDIT
Based on first comment, I was able to fix that issue. Thanks for that!
I have got this error now. Not quiet clear to me how to approach this. Any thoughts?

So now MVC is missing

I recently asked a question about ripping models out of the core ASP.net MVC 3 application and putting them into a class library. See question.
Which was then answered by stating I have to re-install MVC.
well after spending all morning doing that, I got everything to work, accept for one thing: System.Web.MVC which is needed for [Compare] before the reinstall, things like web.secutiry, system.componentmodel.dataannotation were not working but they are now.
The only thing not working is Web.MVC is this going to be yet another reinstall?

How to override and localize client-side validation messages for ASP.NET MVC 4?

I've created custom validators with localized strings which are loaded from my satellite resource assemblies. Now I want to override default MVC messages like "{0} must be a number".
In this article:
http://martinnormark.com/asp-net-mvc-localize-numeric-data-val-number-validation
the author says
I was browsing through the source code of ASP.NET MVC 4, and found a
changeset that looks like will fix this issue. In short, it will be
possible to define your own ResourceClassKey, and the MVC framework
will use that before using default error messages. Nice!
So I started looking how to use the new features but most of solutions seem outdated and don't work or maybe I'm doing something wrong.
How do I override client side error messages in MVC 4 using resource dll files?
Does MVC itself always decide which resource assembly to pick or I can somehow force it to pick the one I need for a specific language?
Somehow this article
http://www.codeproject.com/Articles/42168/Localizing-ASP-NET-MVC
did not appear in my earlier searches.
The key point was to add the App_GlobalResources folder manually and move resource assemblies there, and only then it picked up our custom messages.
For some reason the App_GlobalResources folder is missing when creating MVC 4 app in Visual Studio 2012 so we assumed that it is not needed any more. But when digging through the MVC source code, we found that MVC is using HttpContext.GetGlobalResourceObject which looks in App_GlobalResources. Oh, Microsoft, come on, why are you doing this... we spent three days looking for various complex solutions just because you threw out that folder from the latest MVC version.

Sitecore and MVC3

I am starting a project with Sitecore, I have looked for different possibilities. I have some experience with MVC but I don't understand why you want to combine this with Sitecore (6.4).
What are the benefits? Are there any examples of the implementation of (the code of) this (not the configuration on: http://sdn.sitecore.net/upload/sitecore6/64/integrating%20an%20asp.net%20mvc%20web%20application%20in%20sitecore%20cms-usletter.pdf)?
Or why shouldn't I use MVC with Sitecore?
So when should I use Sitecore 6.4 with MVC3 and when not? And are there any (code)examples?
Thanks in advance!
I've successfully implemented my own MVP implementation using Sitecore. MVP is a bit more forgiving than MVC, and can easily be integrated into web forms based applications. I used T4 templates to generate Models directly from Sitecore templates using the built-in webservices which worked really well.
Sitecore doesn't support MVC yet (in the recommended release), and trying to make it work is probably not worth the effort. I believe they are working on a version that supports MVC properly, which may be the link you provided. However it's probably also very new and there is a lot of functionality in the old version that relies on web forms. I'd like to see it working under MVC in an official capacity for a few more iterations.
Implementing patterns such as MVC and MVP are all about separating concerns and making your presentation layer unit testable. It also encourages more elegant design.
Just reading the doc it looks like this is a guide for running Sitecore in parallel with MVC. I can't see anything about new rendering mechanisms for Sitecore, which would make templating difficult in anything other than web forms. It would however allow you to use the Sitecore API to build your own templates via MVC Views, but you would loose the inline editing functionality that you get out-of-the-box with web forms.
Using mvp is probably the simplest way to go. I wrote a blog post about it here.
However, we have used MVC3 with Razor before and it worked very well. The only issue is you lose the ability to use Page edit mode as you have to do some hacking of sitecore to get it to work. I'm contemplating writing a blog post about it if people are interested.
Just to follow up.. MVC is now supported in 6.6, which will be released on November 5th 2012. We just saw a demo from John West at the Sitecore Symposium and it looks like a great framework. One of the best things about it is that you can use MVC side-by-side with Web Forms. You don't have to make an all-in bet for MVC, you can just slowly migrate or build new components in MVC, while still running Web Forms throughout your site.

what are the advantages of MVC3 over MVC2

i am currently learning MVC2. actually working on my first MVC2 project.As the MVC3 beta is launched and available to download. please suggest me should i use MVC3(Beta) or continue with MVC2 and second thing is, if i move to MVC3 then what major advantages i will get from it.
My project is an ERP application.
Please suggest me what should i do.
Thanks
I suggest you take a look at this blog post from Scott Gu :
http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx
To name some advantages, you can use the Razor View Engine, which depending on your requirements, it will make your view code nicer. I believe that's the case for an ERP System.
This is not 100% mvc3 related, but with the RC you get NuGet installed with it, if you're planning on using external libraries to help you out, that's a great way to manage them.
Partial Page output caching is a great feature for systems that share bits and pieces across different ui's.
Unobtrusive JavaScript and Validation is also another great new feature that will help you keep your code's maintainability among other benefits.
MVC3 also has some benefits from the dynamic aspects of .NET 4, and that also helps you keep your view code cleaner.
And my end point would be, MVC3 is already on RC stage....it already has Go Live license and support...if you're learning, I would suggest learning the latest, you will get all the knowledge you need to use mvc 1 and 2, and also the new things about mvc 3.
One factor is the release date of MVC 3 compared to the release date of your application, i.e. you should not ship an application based on a beta version of MVC.
If you switch to MVC 3 beta, you should be aware that there may be changes in the final release, so you may have to make changes for each version until the relase, and your application is only guaranteed to work with one specific pre-release version, until the final release of MVC 3.

Resources