Browse by Tags

Related Posts

  • ASP.NET MVC Transaction Attribute (using NHibernate)

    This attribute will be applied to any action method within an MVC controller, or even to an entire MVC controller class. It will cause the entire action (or any action in the controller, depending on usage) to be executed inside of a transaction, properly committing the transaction on successful method...
    Posted to Scott's Blog (Weblog) by srkirkland on 09-03-2009, 12:00 AM
    Filed under: Code, ASP.NET, NHibernate, ASP.NET MVC, MVC
  • Using jQuery Ajax methods in ASP.NET MVC: $.get() and $.getJSON() vs. $.post()

    I’m currently working on a project that uses ASP.NET MVC and jQuery to do some Ajax magic, and I ran into a minor (but maybe not obvious) issue when using $.post() against an MVC action that returns a JsonResult. The core issue is that calling $.get or $.post does not by default treat the returned data...
    Posted to Scott's Blog (Weblog) by srkirkland on 09-08-2009, 12:00 AM
    Filed under: AJAX, ASP.NET, ASP.NET MVC, Code, jQuery, MVC
  • A UrlHelper Extension For Creating Absolute Action Paths in ASP.NET MVC

    ASP.NET MVC comes with a UrlHelper class in the System.Web.Mvc.Controller.Url namespace, which you can access through the Url property of any controller.  This provides some handy methods to get the url of an action or route, among other things.  For example, Url.Action(“About”, “Home”) will...
    Posted to Scott's Blog (Weblog) by srkirkland on 09-17-2009, 12:00 AM
    Filed under: Code, Tips, ASP.NET, ASP.NET MVC, MVC
  • Using xVal with NHibernate Validator 1.2

    This will be a quick and dirty post about how to get xVal 1.0 ( http://xval.codeplex.com/ ) to work with the new NHibernate Validator 1.2beta ( http://nhforge.org/media/p/7.aspx ). The problem is that xVal 1.0 ships with a NHibernate Validator (NHVal) Ruleset Provider which does not compile against the...
    Posted to Scott's Blog (Weblog) by srkirkland on 09-29-2009, 12:00 AM
    Filed under: Code, ASP.NET, Validation, NHibernate, ASP.NET MVC, MVC
  • MVCContrib FluentHTML Select Lists and NHibernate

    When using ASP.NET MVC you will eventually want to do a select (drop down) or even a multiple select list, and your first though might be to use <%= Html.DropDownList %>.  Unfortunately you will soon notice that ASP.NET MVC always looks for a match between the name of the dropdown and a property...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-08-2009, 12:00 AM
    Filed under: Code, ASP.NET, NHibernate, ASP.NET MVC, MVC
  • Required Validator For NHibernate Validators

    I’ve recently switched from the Enterprise Library Validation Application Block to using NHibernate Validators. If you are not familiar with the NHibernate Validator project, they are part of the NHibernate Contrib project and offer Validation constraints, and validation runner, and tight integration...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-15-2009, 12:00 AM
    Filed under: Code, ASP.NET, Validation, NHibernate, ASP.NET MVC, MVC, xVal
  • Inserting Transactions into Telerik’s ASP.NET MVC Grid

            Telerik recently released their Extensions for ASP.NET MVC which include several great controls, the most immediately useful of which is their Grid control.  In the simple (and probably most common) cases the grid works by passing taking an enumerable list of...
    Posted to Scott's Blog (Weblog) by srkirkland on 11-10-2009, 12:00 AM
    Filed under: Code, Tips, ASP.NET, NHibernate, ASP.NET MVC, MVC, Telerik
  • Making ASP.NET MVC Actions be Transactional By Default

    In an earlier post I talked about writing a Transaction attribute for MVC using NHibernate (though it isn’t really NHibernate specific).  The basic idea is that when an action marked with [Transaction] is executing (OnActionExecuting) you begin a transaction, and some time later (I use OnActionExecuted...
    Posted to Scott's Blog (Weblog) by srkirkland on 11-16-2009, 12:00 AM
    Filed under: Code, Tips, ASP.NET, NHibernate, ASP.NET MVC, MVC
  • Authorizing Access via Attributes in ASP.NET MVC Without Magic Strings

    Recently I developed a strategy which I think works well for authorizing access to user groups (Roles) without using the string names of those groups. The problem I am trying to avoid is doing something like [Authorize(Roles=”AdminRole”)] on a controller or action since I know the role names can change...
    Posted to Scott's Blog (Weblog) by srkirkland on 01-04-2010, 12:00 AM
    Filed under: ASP.NET, ASP.NET MVC, Code, MVC, Tips
  • An xVal Provider For NHibernate Validator

    I wrote a post about a month ago about using xVal with NHibernate Validator 1.2 which solved a problem I was having upgrading the xVal ‘in-the-box’ provider to work with a newer version of NHibernate Validator . There was a caveat that my solution only worked for ValidatorMode.UseAttribute and I wouldn...
    Posted to Scott's Blog (Weblog) by srkirkland on 11-02-2009, 12:00 AM
    Filed under: Code, ASP.NET, Validation, NHibernate, ASP.NET MVC, MVC, jQuery
Page 1 of 2 (11 items) 1 2 Next >