Category: MVC

  • The model item passed into the dictionary is of type ‘[]’,but this dictionary requires a model item of type ‘[]’

      I am tired of how many times I found this question on forums. So,if  you encounter this error The model item passed into the dictionary is of type ‘xxx’,but this dictionary requires a model item of type ‘yyy’ with the variation The model item passed into the dictionary is of type ‘xxx’,but this dictionary…

  • MVC 5 encrypt parameters–SEO

      I have added SEO ( ok,a bullshit example of SEO ) to http://msprogrammer.serviciipeweb.ro/2017/03/20/mvc-5-encrypt-parameters/ . This is pretty simple :   the action is <a href=’@Url.ActionEnc(new EncDecSEOBullShit(),”TestEncryptSEO”,new {id=7,a = 1,b = “asd” })’>Test</a> It generates url such as: http://mvc5encrypt.apphb.com/Home/TestEncryptSEO/7?a=this-is-seo-1&b=this-is-seo-asd The Action Filter to decrypt takes the full type name ( with assembly name) of the…

  • MVC 5 encrypt parameters

      This is an old idea that I was having. The problem was that,for many people,showing the parameters in MVC is not something that they want . For example. suppose that we have this action     The this action can be activated by putting in the Razor cshtml file this   <a href=’@Url.Action("TestEncrypt",new {…

  • Five common mistakes for ASP.NET MVC accesing resources : css,js,images,ajax

    This is a Razor /MVC5 variant of older post http://msprogrammer.serviciipeweb.ro/2010/10/09/five-common-mistakes-for-asp-net-mvc-accesing-resources-css-js-images-ajax/ To have once for all the link to show to people,because too much makes the same error again and again. (From here – you can use ResolveUrl or Url.Content – it’s the same for me. I use ResolveUrl because I used first …) Case 1…

  • Swashbuckle.MVC

      The Swashbuckle package for documenting WebAPI is really awesome. I have used for documenting Exporter API for Word/Excel/PDF/ODS/ODT. One problem though: It does not respect the layout of your site. For example,if the original header is this   when  I click on API test(swagger)   . This is not what I want – since…

  • ASP.NET MVC–find error

    I am moderator and a frequent answerer at forums.asp.net . Mostly of time the error is in thinking that database connection errors belong to MVC – or other things that are part of the .NET framework,not of MVC . However,I must write here the most confusing problem  that I have encountered: <start quoting> “I have…

  • Minimize Json

    TL;DR: Minimize Json Answer by minimizing the names of the properties transmitted. As a practical example,see http://jsonminimize.apphb.com/ ( although is gzipped,the answers are 3862 versus 3089 bytes – an 20% gain . Your results will vary – because of how I obtain the random obtaining of data )   Prerequisites: Ajax / Json   – http://msprogrammer.serviciipeweb.ro/2011/12/05/jquery-ajax-request-and-mvcdetailed/…

  • Javascript MVVM and ASP.NET MVC

    TL;DR; The purpose of this article is to show is how to transmit data to edit( create,update,delete) from a MVVM array to an ASP.NET MVC action in order for the action to bind to an IEnumerable/Array/List of objects. We will make also a javascript function that can be re-use across multiple MVVM frameworks to transmit…