Home / ASP.NET Weblogs

Browse by Tags

Related Posts

  • using ASP.NET Validation from client code

    I recently ran into a scenario where I needed to have a submit button exclusively run some client code, which is pretty common and usually handled by having some DOM element call an onclick method that does the work.  However, there was quite a bit of validation that needed to be done and I did...
    Posted to Scott's Blog (Weblog) by srkirkland on 02-13-2008, 12:00 AM
    Filed under: Code, Tips, ASP.NET, AJAX
  • Exporting a SQL Server Reporting Services 2005 Report Directly to PDF or Excel

    Exporting a SQL Server Reporting Services 2005 (SSRS) Report Directly to PDF/Excel is a handy way of generating high quality reports without being stuck to using the ReportViewer interface. Sometimes the ReportViewer interface is an unnecessary step, but other times the ReportViewer won't render correctly...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-29-2007, 12:00 AM
    Filed under: Code, Tips, ASP.NET, Report Server
  • .NET 2.0 Cast operator vs. As operator

    When I was converting untyped data values from a SQL database into a custom Business class, I realized that I have to take a special precaution when casting possibly null values. If you try to cast DBNull to some type, you will get an InvalidCastException. When thinking about a solution, I remembered...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-29-2007, 12:00 AM
    Filed under: Code, Tips, ASP.NET
  • 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
  • Base Class Object Equality for NHibernate Objects

    In any project where you use an ORM you often have all of your domain classes inherit from a common base class.  Among other things, your base class often contains your identity property.  Mine has a protected IdT (this is the Id type) field called id, and a public getter called ID. 1: protected...
    Posted to Scott's Blog (Weblog) by srkirkland on 09-21-2009, 12:00 AM
    Filed under: Code, Tips, ASP.NET, NHibernate
  • Common Web.Config transformations with Visual Studio 2010

    I’ve been playing with Visual Studio 2010 Beta a little and one of my favorite new features (and there are many) is the new web.config transformation feature. Web.config transformations are setup so there is one configuration “delta” for each build configuration that you have (default are Debug and Release...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-13-2009, 12:00 AM
    Filed under: Code, Tips, ASP.NET, Visual Studio
  • Major Hack: Repository Tests With NHibernate And SQLite on a CI Server

    I recently setup my first continuous integration build server using JetBrains’ TeamCity product, and it couldn’t have been much simpler. However I kept running into an issue with my test projects whenever I was using NHibernate or SQLite (very useful or regression tests against an in-memory database...
    Posted to Scott's Blog (Weblog) by srkirkland on 10-20-2009, 12:00 AM
    Filed under: ASP.NET, Code, NHibernate, Tips
  • 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
Page 1 of 2 (16 items) 1 2 Next >