Showing posts with label ASP.NET MVC. Show all posts
Showing posts with label ASP.NET MVC. Show all posts

Monday, 25 November 2013

TFS Error - There is not enough space on the disk

I've been working on trying to automate our development workflow or in other words I've been banging my head against the TFS wall trying to set up CI.

I thought i had everything working when I encountered this little beauty for one of the ASP.NET projects:

The build server had over 20 GB of free space, so I was somewhat baffled by this error message, so I did what every self respecting IT professional does: I started bouncing stuff.

After I bounced, the build agent, build service and the server itself, all to no avail, I hit the interwebs where I found the solution.

This error has got nothing to do with disk space, it's related to tempory files not being deleted in this folder:
C:\Windows\Microsoft.net\Framework64\<version>\Temporary ASP.NET Files
I checked the folder and sure enough there was a subfolder with the name of one of the projects. I deleted this and the builds started to complete again.

Sunday, 7 April 2013

Applying CSS classes in ASP.NET MVC fields

I'm a total newbie when it comes to ASP.NET MVC and a few days back I was looking at issue where the font size was different on two text controls on the same form. One of the controls was a single line text box, while the other was

This is the original code, which I thought would apply the fields class to the controls:

<fieldset>              
   <div class="label">              
     @Html.LabelFor(model => model.Title)              
   </div>              
   <div class="field">              
     @Html.EditorFor(model => model.Title, new { autocomplete = "off" })          
     @Html.ValidationMessageFor(model => model.Title)              
   </div>              
   <div class="label">              
     @Html.LabelFor(model => model.Details)              
   </div>              
   <div class="field">              
     @Html.TextAreaFor(model => model, new { rows=10, cols=50 })            
     @Html.ValidationMessageFor(model => model.Details)              
   </div>              
</fieldset>              

The problem was that this wasn't working and I couldn't work out why. After looking at the styles one too many times, hangs head in shame, I realized that it was picking up the styles from the user agent rather than the css file.

A bit of searching revealing that this is what I should have done instead:

<fieldset>              
   <div class="label">              
     @Html.LabelFor(model => model.Title)              
   </div>              
   <div class="field">              
     @Html.EditorFor(model => model.Title, new { autocomplete = "off", @class=editor })              
     @Html.ValidationMessageFor(model => model.Title)              
   </div>              
   <div class="label">              
     @Html.LabelFor(model => model.Details)              
   </div>              
   <div class="field">              
     @Html.TextAreaFor(model => model,10,50, new {@class=editor })            
     @Html.ValidationMessageFor(model => model.Details)              
   </div>              
</fieldset>