posts - 81, comments - 262, trackbacks - 0

Web Programming

Migrating an MVC site to Orchard Project 2 (Part 2)

I've started migrating my application into the module. The major consideration has been handling the use of LINQ to SQL and the Entity Framework together. My MVC application uses LINQ to SQL. I had to regenerate the data context with sqlmetal to resolve some odd errors when working with NHibernate. In particular my data context was generated by an old version of sqlmetal – it just needed an updated generation. I found it useful to create a BAT file to regenerate the context for me. call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat" sqlmetal /server:MACHINENAME /database:DBNAME /code:DataContext.cs /language:csharp /views /functions...

posted @ Sunday, December 2, 2012 2:55 PM | Feedback (13) | Filed Under [ Web Programming ]

Migrating an MVC site to Orchard Project (Part 1)

I have been moving an asp.net MVC web site of mine to the Orchard Project. As a developer I love working with MVC, however, I had not found a nice solution for content management. All of the solutions were too intrusive, tainting the MVC flavor of the site, or rather young projects I didn't want to invest in. A recent survey of Content Management System (CMS) solutions found me looking right at the Orchard Project. The project is not 'light', but it is very elegant. The project uses the 'MS Web Stack of love' which...

posted @ Sunday, November 11, 2012 4:51 PM | Feedback (2) | Filed Under [ Web Programming ]

Simple method to constrain stored procedures by a collection

Passing a collection of ID's to filter a SQL query within a stored procedure is not natively supported. Consider this article which discusses methods for passing arrays into a stored procedure. Constraining a stored procedure's query has a simple work around, however. Passing the ID collection as a comma deliminated string allows the query to use LIKE to constrain the results. Note that the preceding and trailing commas are necessary. An example demonstrates how to do this easily.  DECLARE @Ids varchar(max); set @Ids = ',1,2,3,4,5,'; Select * from [TableName]     WHERE @Ids LIKE ('%,' + cast(TableID as varchar(50)) + ',%')

posted @ Saturday, April 7, 2012 4:12 PM | Feedback (2) | Filed Under [ Web Programming ]

Update Summer 2011

I have been lax in updating posts on the blog.  Mostly this is because I have been transitioning from web development to my Ph.D. research work in Aerospace Engineering over the last two or so years.  The topic of the blog thus far has been mostly web development related, with less significant posts on the topic recently. I’ve decided to transition the blog into my current focus, research, as my personal focus has also shifted (it is a personal blog after all).  As part of this I have updated the blog engine itself (subtext).  Many thanks to those at...

posted @ Monday, June 20, 2011 3:18 PM | Feedback (6) | Filed Under [ Web Programming School ]

Skype an IIS Gotcha

 I was getting the following error after installing IIS and starting a new Web Site in Windows 7  --------------------------- Internet Information Services (IIS) Manager --------------------------- The process cannot access the file because it is being used by another process. (Exception from HRESULT: 0x80070020) --------------------------- OK ---------------------------  And in the System Event Log:  The World Wide Web Publishing Service (WWW Service) did not register the URL prefix http://something.local:80/ for site 1. The site has been disabled. The data field contains the error number.  It turns out Skype automatically listens to port 80 and 443. Change this is the advanced settings of Skype to fix the issue.

posted @ Tuesday, January 18, 2011 9:22 PM | Feedback (2) | Filed Under [ Web Programming ]

Undo Within Selected

Today I was working on some code, nothing particularly different than any other day. I did something I have done thousands of times before, made some changes, and then needed to get previous code back. This was quickly done with undo several times, copy to clip board, redo several more and then paste. Then it hit me, why don't we have an undo within selected text? We have a search and replace within selection. Undo within selection complements the search and replace really well, and further, allows for quicker retrieval of code several edits ago....

posted @ Sunday, June 7, 2009 12:53 PM | Feedback (0) | Filed Under [ Web Programming ]

ASP NET MVC Version 1 Released

Version 1 of ASP.NET MVC has been released, presumably for MIX in Vegas. It's been a year following the project, and it's exciting to see MVC released after three years of development since March 16th 2007. http://www.microsoft.com/downloads/details.aspx?FamilyID=53289097-73ce-43bf-b6a6-35e00103cb4b&displaylang=en Overview ASP.NET MVC 1.0 provides a new Model-View-Controller (MVC) framework on top of the existing ASP.NET 3.5 runtime. This means that developers can take advantage of the MVC design patterns to create their Web Applications which includes the ability to achieve and maintain a clear separation of concerns (the UI or view from the business and application logic and backend data), as well as facilitate...

posted @ Wednesday, March 18, 2009 9:21 AM | Feedback (0) | Filed Under [ Web Programming ]

Unifico Load Tested with and without WCF Remoting

This is rather exciting to me; I just ran a few load tests on Unifico with and without remoting the services with WCF bindings. I knew the application could remote. The concern was how efficient. I created a quick web test that simply goes through the admin, lists the admin lists, performs a filter, edits and saves an item, then logs out. Roughly every action was hit (eh, it's a spike :)). I then setup the bindings and ran a load test remotely and locally (remotely being hosted on 127.0.0.1). I like to call the...

posted @ Sunday, January 11, 2009 1:32 AM | Feedback (0) | Filed Under [ Web Programming ]

Using a Recursive Expression to Create an Html Menu

I find recursive expression to be really useful. They are particularly handy when dealing with parent child relationships. As a demonstration, see a potential method for generating a site map below:     1 using System;     2 using System.Collections.Generic;     3 using System.Linq;     4 using System.Text;     5      6 namespace SiteMapDemo     7 {     8     class MenuItem     9     {    10         public Guid ID { get; set; }    11         public Guid? ParentID { get; set; }    12         public string Name { get; set; }    13         public string Path { get; set; }    14         public int Rank { get; set; }    15     }    16     class Program    17     {    18         static void Main(string[] args)    19         {    20             List<MenuItem> menu = new List<MenuItem>(new[]{    21        ...

posted @ Thursday, January 8, 2009 7:40 PM | Feedback (0) | Filed Under [ Web Programming ]

Paging with Filters and Sorts added to Unifico

Two new additions were added to Unifico: filtering on fields and sorting on fields with the help of Html Extension methods. A PagingSet class was defined to contain configuration options for the paging. In this way a View can still page on more than one list and maintain complete control over the Html rendered. Every string used in the Html Helpers is pulled from the configuration (A default is made available). Several extension methods were added to the Html Helper to make rendering the controls easier. The filtering html form can be rendered with <%= Html.FilterInput(Paging, "Go")...

posted @ Sunday, January 4, 2009 6:25 PM | Feedback (2) | Filed Under [ Web Programming ]

Full Web Programming Archive

Powered by:
Powered By Subtext Powered By ASP.NET