Posts

Showing posts with the label Asp.net MVC

Inheriting Apps with Asp.net MVC

While cleaning up some code in the webconfigs of an Asp.net MVC application I came across a line of code to which I had no knowledge of and even more so was showing up as an error.  I asked myself was it's purpose and most of all why was the Intellisense saying "The 'inheritInChildApplications' attribute is not allowed."? Resources How do I allow all users access to one route within a website with integrated auth? - Stack Overflow Changing ASP.NET web.config inheritance when mixing versions of child applications - Scott Hanselman Conclusion All the information can be seen and found in the following links but after looking at the comments you will find the reason behind the shown error.  " Be aware that the inheritInChildApplications attribute is not part of the web.config schema (even in VS 2012) so you will get blue  squiggles  under it with a message of "The 'inheritInChildApplications' attribute is not allowed." It will, however,

HTML Select Placeholder

Update     Adding a selected and disabled attribute works as well and doesn't require any javascript, however refreshing the page does not reset the value. Doing a hard refresh does reset the value (for firefox) . However there seems to be a placeholder attribute in draft (as of november 2014).  " When there is no default option, a placeholder can be used instead". However in the example the placeholder value is still selectable after a choice has been made. This may not be what you want, so combining the two attribute and the javascript below  guaranty the behavior I'm looking for.  I could even support older browser with a little work.     The Purpose of this article is to make a placeholder in select that should help prevents bad selections with and make it easier to validate if no selection is made. In this article I will assume you have Jquery and the Jquery Validation plugin installed on your web application and similar html code displayed like the the fo

A Static DropDownList for ASP.Net MVC

Image
     When creating a static dropdowns list in Asp.net MVC, I have a two approaches that I like to commonly use. I know there are many ways to achieve this UI structure and I don't consider either one of the following approaches to be the final solution. However for awhile now  I have been using these two approaches  and I think they are  much  simpler  and easier to maintain  compared to other ways that I have seen . Rather than writing out the HTML select tag and all the options I take advantage of the Html Helper Dropdownlist. I avoid model bind since it is static and I don't want create the list outside of the view. I think this would only create more work to maintain and confusion for other coders if they new to my applications.  I did not come up with either solution  completely on my own and I actually forget where I saw them since it did take a while to find these approach in my research.   What's  important to take away in this article is that if you look carefull

Popular posts from this blog

UI-Bootstrap Collapsible Sticky Footer

Installing Windows on Acer chromebook 15 cb3-532

Aspetcore: NLog with Postgresql