I have been working recently with ASP.NET MVC 3 and the Razor view engine. For part of the work I’m doing, I need to send some content to the browser based upon certain conditions. I described a couple of ways to do this before in this post and this post and I wanted to share
I posted recently about sending raw unencoded HTML to the client using the Html.Raw() method with MVC 3 and the Razor view engine. I wanted to extend a bit on that post regarding the magic underlying the Html.Raw() method, the HtmlString class in the System.Web namespace of the .NET framework class library. You can use the
By default, the HTML 4 specification does not allow disabled form control values to be submitted with other values in a form. Sometimes you want to submit the value from a disabled control like a text box, though, and here I demonstrate an approach to submitting a disabled form control value using a hidden form control.
I’m working on an MVC Razor project and need to output some raw HTML to disable an HTML text box if the text box is populated with a value. I realized, though, that my initial attempt didn’t render quite the output I expected. My original code to output the disabled=”disabled” attribute (gotta love XHTML compliance!) was
I’m working on a CSS style sheet and using the background-image property to set up an image in a header. I seem to forget from time to time how to correctly form a relative URL in CSS, especially when switching contexts back and forth between client- and server-side programming as well as moving in and
I’m relatively new to blog authoring in general and to using the WordPress platform for blogging in particular. The first few months of articles I’ve authored have included a number of source code references—PowerShell, C#, HTML, CSS and others—and I’ve put in source code using the Preformatted style. This works okay but I kept drooling