posted 08/20/2009 by Arthur Correa | 0 comments
I know I haven't posted in a while.  I took the last month or so to convert my DAL over to use NHibernate instead of LINQ to SQL.  Why the change?  Well, when I first started this project the idea was that I would use this as a vehicle to try new technology.  NHibernate was one of those things on my list to try.  On top of that I started using it on another project at work, and honestly found I liked it a little bit better than LINQ to SQL.  More details to come, I just wanted to get some sort of post up here since its been so long (and also test out that my insert code still worked after the switch).
full article

posted 06/12/2009 by Arthur Correa | 0 comments
Ok so as I implemented my blog software for this site I had to figure out a way to display error messages to the user.  For example if I had a required field that the user didn't fill in I wanted to alert the user to fill in that field. My first thought was that MVC should have something to handle this, so I was going to start there.  Unfortunately, after looking around a lot online, I realized that at the time MVC didn't have that.  So what to do? Well I have a base class for all of my Models, can I put something in there?  Just about every screen might have a need to return an error message so why not?  Ok, I had a place to put my errors, but how would I actually implement them?  I decided upon using a Dictionary to hold the messages.  The key to the dictionary would be the name of the control that the error message was associated with, and the value was the error message itself.  Then in my page code I checked that dictionary for any
full article

posted 05/27/2009 by Arthur Correa | 0 comments
When I first launched this blog I found I was frequently getting the following error. Object reference not set to an instance of an object. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [NullReferenceException: Object reference not set to an instance of an object.] IIS7Injector.InjectedContentStream.Write(Byte[] buffer, Int32 offset, Int32 count) +146 System.Web.HttpWriter.FilterIntegrated(Boolean finalFiltering, IIS7WorkerRequest wr) +265 System.Web.HttpResponse.FilterOutput() +80
full article

posted 05/03/2009 by Arthur Correa | 0 comments
So I had my infrastructure in place for allowing plugins on this blog, now I wanted to add some sort of storage mechanism for those controls. My first thought was they could just connect to the database and add tables themselves, but there were a few things I didn't like about that. I wanted the blog site to just grab the plugin and be able to immediately use it.  However that would require allowing the control to add tables to the database.  Which means I'm writing code that uses a connection with db admin level permissions.  I didn't like that at all.   Now maybe if I had a separate database for plugins this could be an option, but still a poor one, but a separate database wasn't an option anyway.  So for security purposes if the plugins wanted to add data access they would need to do a separate step to run a db script.  Pfft. I also didn't like that granting the plugins data access would potentially allow them to manipulate the core blog data as w
full article

posted 05/02/2009 by Arthur Correa | 0 comments
Okay so I had found a way to do MVC plugins, but it didn't work in my environment.  So now what do I do? Well I still wanted to work in the MVC framework somehow.  Maybe not for showing my plugin control, but I did want to somehow handle form submissions cleanly.  Mainly for administering my control (configuring it as neccessary).  So what did I do? Well I went back to the way I've done plugin architectures in the past.  I defined an interface that would get used by my site to interact with the plugin.  The interface looks like public int ExtensionId - Uniquely identifies this plugin. public virtual bool IsBlogSpecific() - Is the control configured differently for each blog, or the same configuration for the entire site? public virtual ExtensionDisplay ControlDisplay - How to display the control on the page and handle its submissions. public virtual ExtensionDisplay AdminDisplay - How to display and admin UI and handle its submissions. bo
full article

posted 05/01/2009 by Arthur Correa | 0 comments
So my blog software was pretty much fleshed out.  I could write posts, have tags, have a calendar of posts, an archive links.  Multiple blogs, mutliple blog writters per blog, File uploads, WYSIWYG text editing.  All in all I was pretty pleased. Now though I was starting to get into personalizing my blog with some controls that only I may care about.  Since I'd like to share this software with others and let them use it I thought it would be better if I made these features optional plugins.  No problem I've done plugin architectures in Win Forms, and in ASP.Net, how bad could it be in ASP.Net MVC?  Unfortunately it was conceptually easy, but ended up being prettty technically challenging.  I started off thinking that I'd do it like any other sort of plugin architecture.  I'd define an interface for my plugins, and then anythign that implemented that interface I could dynamically load and integrate, but the more I thought about it, the more I re
full article

posted 04/02/2009 by Arthur Correa | 0 comments
I thought it was pretty interesting to hear that Microsoft is releasing this new .Net technology under the Microsoft Open License.  It was announced on Scott Gu's blog (no big surprise there, he is the source for all the best information about ASP.Net MVC)I think this is a great move on Microsoft's part.  It puts them on the same playing field as other MVC technologies that are making headway into the developer market.  From talking to some of my friends it works a lot like Grails and Ruby right down to the file layout.  Sure all three have some differences, but overall they sound pretty similar.Having become such a big fan of MVC I'm hoping that this move makes this new Microsoft Release successful.
full article

posted 03/24/2009 by Arthur Correa | 0 comments
Ok so I had the basics of an ASP.NET MVC blog site up and running.  I had my data layer written using LINQ, I had my business layer defined with Services and Entities, and I was starting to build my MVC code on top of those.  I had figured out how and where I wanted to do Ajax, and how to page my result sets.  Now I decided I wanted to implement a calendar. Now if I was doing a Web Forms project I'd just grab a Calendar control and drop it onto the page.  Then tell it what dates to highlight server side.  Unfortunately I didn't have that option. The first thing I did was go out and look for some sort of open source/freeware sort of control that did what I wanted it to do.  I managed to find one provided by Yahoo here.  I started to use it, and it was sort of working.  I got it on the page, I managed to start styling it with CSS, and I was starting to set the dates on the calendar. I found it a little bit more than I needed though.  It's a pretty powerful calendar, and I'm sure it works
full article

posted 03/21/2009 by Arthur Correa | 0 comments
Ok so I had the basics of an ASP.NET MVC blog site up and running.  I had my data layer written using LINQ, I had my business layer defined with Services and Entities, and I was starting to build my MVC code on top of those.But now I was finding that I needed to page a number of things such asUser lists when administering siteBlog lists when administering siteBlog entries Tag managementAnd I'm sure there are a few other things that I'm forgetting about right now, but those are the bigs ones I recall.So how did I do it?  Well at first I was thinking about writing my own control, but then I decided I'd do a little research first and see what other people were doing.  It was definitely possible that something already existed in the MVC framework that I didn't know about.Well after searching for a while I came to the conclusion that there wasn't anything in MVC yet, but there were some alternatives.  In particular I found this and this.  I ended up going with the first one that I found on
full article

posted 03/11/2009 by Arthur Correa | 0 comments
Something nice for the user experience.What do I mean?  Well take the login section for example.  That little login section up above to the right gave me some problems.  How could I have an mvc submission for a login action, but still get sent back to the same view? My first thought was that I could just get the name of the current view and just return that from the controller action.  Nope, I couldn't find anything that gave me that information.Now what?  Well the easiest thing is to just do an AJAX submission to just submit and refresh that section of the page.  Okay, MVC has some support for AJAX so lets look into doing that.   using (Ajax.Form("SendMail", new AjaxOptions { UpdateTargetId = "resultDiv" })) {    Your form elements here } using (Ajax.Form("Login", new AjaxOptions { UpdateTargetId = "loginDiv" })) { } Pretty basic, define a form with some controls to submit via ajax and update a specific div with the return results.  Okay this sort of worked, but I actually wanted to
full article



1234567
891011121314
15161718192021
22232425262728
2930311234
567891011