Monday, June 8, 2009

loginUrl for Forms Authentication in ASP.NET MVC on a Hosted Site

While implementing an ASP.NET MVC site which was hosted by an ISP I followed this information from MSFT since the server is running IIS6 and I could not access the web server to configure it for MVC.

This resulted in the following route maps in Global.asax.cs

//Hosted Configuration: Uses .aspx in IIS.
//If MVC installed can map directly.
routes.MapRoute(
"aspx",
"{controller}.aspx/{action}/{id}",
new { action = "Index", id = "" }
);

routes.MapRoute(
"Default",
"{controller}/{action}/{id}"
);

routes.MapRoute(
"Root",
"",
new { controller = "Home", action = "Index", id = "" }
);

I then implemented FormsAuthentication using the

[Authorize(Roles = "User")]

attribute on my actions.

However, when the user visited a "page" w/o sufficient permissions the standard loginUrl attribute of the element in web.config did not work.

loginUrl="~/Account/LogOn"

After some thought I realized the loginUrl value needed to follow the mapped routes and changed it to

loginUrl="/Account.aspx/LogOn"

which works nicely.

Saturday, April 4, 2009

Miguel de Icaza on Mono 2.0 @ Boston .NET User Group Wed 4/8

Miguel de Icaza will return to the featured speaker at the April 8th meeting of the Boston .NET User Group at the Microsoft Waltham MA Office. This will be a great evening for anyone working with the .NET Framework whether it's on Linux or Windows. Few people know more about the Framework than Miguel and he's a great speaker. So bring your ?s. Hope to see you Wednesday.

Sunday, March 1, 2009

jQuery Presentation by John Resig


Recently, we had the pleasure of having John Resig, the creator and lead developer for the jQuery library speak at the Boston .NET User Group meeting.
For those of you not familiar w/ jQuery, it is a JavaScript UI library that packs an incredible punch for it's very small size.
John's presentation showed the tremendous power and flexiblity of jQuery for enhancing the UI of a web page/site. I've been using it for about 8 months and never looked back. The jQuery library is one of those tools that comes along and changes the paradigm of a playing field. Combined w/ the jQueryUI collection of UI components this is a must have for web developers. Check it out!

Monday, February 9, 2009

John Resig: jQuery Creator at Boston .NET User Group this Wednesday 2/11

John Resig, the creator and lead developer of jQuery will be the featured speaker at this Wednesday's 2/11 meeting of the Boston .NET User Group. Check out the details a www.bostondotnet.org.

New England Code Camp 11

The next edition of the always popular New England Code Camp will be held on Saturday March 28th. We're holding a one-day mega event which should be packed with lots of great material. Submission of speaker abstracts and registration is now open at www.thedevcommunity.org. Chris Bowen has a detailed description of the event post on his blog.

Wednesday, January 28, 2009

Miguel de Icaza, Founder of the Mono Project to Speak at April 8th Boston .NET User Group Meeting

Miguel de Icaza, founder of the Mono Project will be the featured speaker at the 4/8/2009 meeting of the Boston .NET User Group meeting in Waltham, MA at the Microsoft office from 6-8 pm. Miguel will be giving a tour of Mono 2.2. Previous visits to the group have been very informative and entertaining. If you are in the area, this is a meeting not to be missed!

Monday, January 26, 2009

Microsoft Virtual 24-hr TechDay 4/1/2009: Call for Speakers

Microsoft is holding a virtual 24-hr TechDay on April 1st where any and all individuals are welcome to submit a proposal. For more information visit http://www.msfttechdays.com/modules/cft/default.aspx.