tags:

views:

23

answers:

1

i want that browser will accept request for only login page all other request should not be acceptable . actually i don't want to check that user is login or logged out from site with Authorize attribute. i just want to disable all requests of web pages(URL's) except login page from site.

something like:

routes.MapRoute(
             "Default",
             "{main}.mvc/{login}/{id}",   ////////just example for only action to run///////
             new { action = "Index", id = "" }
           );
A: 

I got It

if i will make some changes like following than i can make my website to search for only one page that is login page and reject all request for other Unauthorizes pages (actions).

      routes.MapRoute(
          "login",
          "{Main}",          /// instead of "{controller}.mvc/{action}/{id}"/////////
          new { controller = "Main", action = "login", id = "" }
        );

but i don't now how its working any one want to tell me whats the basic funda or i am doing wrong?