If you are in a company in which the Fiscal Year does not start January 1st, it might become necessary in your code, to figure out what the actual Fiscal Year is at any point during the year. The following is a method (in C#) which returns a string based on the fact that the […]
I wanted to change the .Net Framework of my C# Windows app. Every site I went to to find out where to change said to right click on the project to get the properties page. Then, I would be able to change it in the ‘Target Framework’ dropdown. I never could see that dropdown.
In WebForms, first we had a DataGrid and then the GridView that we relied on for our grid type presentations. Well, once we started using MVC, it was a little more difficult since there are no ‘controls’ per se.
This problem has been around since Classic ASP and is still there, in ASP.Net, when using an Access Database. The problem shows up when trying to update the database, but there is an easy fix.
Everyone using MVC generally knows about the ‘Required’ attribute for properties in the model. It’s surrounded by square brackets and placed just above the property. However, what if you want to change the displayed message to more user-friendly text? Well, it turns out that it’s very easy.
For those of us who came from a VB background, we know how great the immediate if is (iif). To do this in C#, it’s not so straightforward it seems, at least at first, but it’s just as easy and useful. Here’s how it’s the framework is done in C#: yourBool ? “true” : “false”; […]
Let’s say you have a TextBoxFor in your page to display a date (based on DateTime in the model): @Html.TextBoxFor(model => model.dateFrom) But, since it just displays something like “1/1/0001 12:00:00 AM“, you probably don’t like that.
You’ve probably wondered, along the way using MVC, what the advantages or differences are between the Editorfor HTML Helper and the TextBoxFor HTML Helper.
As a web designer, somewhere along the way, you have come to a site with a TextArea, and even though it notes the maximum number of characters for the textbox you’re about to type in, you never really know how many characters are left as you type, because there’s nothing visual showing you. I’ve used […]
All Things DotNet Discussed – Winforms/ASP.Net/SharePoint/WPF