Software solutions since 1986
Skip Navigation LinksiDevTech > HOME
 
iDevTech Blog
More...
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.
By Chris Pels
Posted 14:43 GMT-04
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.
By Chris Pels
Posted 12:58 GMT-04
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!

By Chris Pels
Posted 17:32 GMT-05
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.
By Chris Pels
Posted 10:18 GMT-05
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.
By Chris Pels
Posted 10:13 GMT-05