Archive

Archive for the ‘ASP.NET MVC’ Category

SharePoint 2007 – Using Firefox and Firebug to Debug CSS

November 27, 2009 Leave a comment

Download Firefox

Debugging the CSS that comes with the style sheets (CSS) in SharePoint 2007 can be challeging at times.  The best tool I’ve found is a plug-in for Firefox called Firebug.  This demo shows how to use Firebug to “test out” how certain CSS changes will look and to determine which CSS file is being used – remember the ‘C’ in CSS stands for cascading.

Also, modifying the OOTB SharePoint style sheets (e.g. ‘Core.css’, etc) is NOT recommended and goes against best practices.  For more information on CSS, see this CSS Tutorial from w3schools. The best online source for information on branding SharePoint is contained in Heather Solomon’s blog.

ASP.NET MVC – A Quick Introduction & Example

November 19, 2009 Leave a comment

The ASP.NET MVC (model-view-controller) is an implementation of the popular MVC design pattern, but as the name implies, is ASP.NET-specific.  The following example demonstrates the creation of a complete (albeit simple)  Visual Studio project, database, and MVC code.

Step 1:  create the MVC project with Visual Studio.

Step 2:  create the SQL Server database.

Step 3:  create the controller.

C# [FootballStatsController.cs]

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
using FootballStatsMvc.Models;  // add reference to our model

 

//
// GET: /FootballStats/
public ActionResult Index()
{
       var statsDB = new FootballStatsDataContext();
       var players = statsDB.Players;
      
       return
View(players);
}

 

Step 4:  create the model.
Step 5:  create the view.
Step 6:  add the new tab to the master page.

Source: FootballStatsMvc.zip

Categories: ASP.NET MVC, C#, LINQ Tags: , ,
Follow

Get every new post delivered to your Inbox.