I have everything in order, and I think that this may be a mistake in the implementation of Microsoft MVC. I am building an MVC website using VS2008 SP1. In an attempt to block my site, I edited my controller to look like this:
1 public class IdeaController : Controller
2 {
3 [Authorize(Users = "whozmom")]
4 public ActionResult Index(string zapp, int? page)
I use ASP.NET membership and form authentication. When I publish my code on my host, it opens a Windows authentication dialog. I rack my brains trying to figure out what kind of editing I could do to trigger this. I completely rewrote my application, trying to figure it out, and narrowed it down to one change in my Global.asax.cs file. First, let me show you (the relevant part) the version you have heard:
1 routes.MapRoute(
2 "Ideas",
3 "{zapp}/{page}/",
4 new { controller = "Idea", action = "Index", zapp = "Office", page = "" }
5 );
6
7 routes.MapRoute(
8 "Default",
9 "{controller}/{action}/{id}",
10 new { controller = "Idea", action = "Index", id = "" }
11 );
, ... . , Windows. , :
1 routes.MapRoute(
2 "Ideas",
3 "Ideas/{zapp}/{page}/",
4 new { controller = "Idea", action = "Index", zapp = "Office", page = "" }
5 );
6
7 routes.MapRoute(
8 "Default",
9 "{controller}/{action}/{id}",
10 new { controller = "Idea", action = "Index", id = "" }
11 );
. # 3, "/" URL. - ? , ( № 3 ), , , .
UPDATE: :
<membership>
<providers>
<clear />
<add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider,
System.Web,
Version=2.0.0.0,
Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a"
connectionStringName="ApplicationServices"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
requiresUniqueEmail="false"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="5"
minRequiredPasswordLength="6"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
applicationName="/" />
</providers>
</membership>