c# - Resource not found error -
i have problem accessing method on homecontroller. show code of method :
[httpget] public actionresult decriptidentifiantetredirige(string login_crypter, string mdp_crypter) { string loginacrypter = _globalmanager.protegemotdepasse(login_crypter); string mdpacrypter = _globalmanager.protegemotdepasse(mdp_crypter); user userapp = new models.user(login_crypter, mdp_crypter); if (userapp.authentificationvalidee(userapp.userlogin, userapp.password)) { session["name"] = userapp.userlogin; return redirecttoaction("accueil", "home"); } else { return redirecttoaction("validerauthentification", "home"); } }
then in routeconfig.cs wrote route :
routes.maproute( name: "authentificationapresdecryptage", url: "{controller}/{action}/{login_crypter}/{mdp_crypter}", defaults: new { controller = "home", action = "decriptidentifiantetredirige", login_crypter = "", mdp_crypter = "" } );
but problem when try access method in browser link: "http://mydomain.com/decriptidentifiantetredirige/12345/54321" shows me error : "resource not found".
somebody has idea ? thanks.
try this,
routes.maproute( name: "authentificationapresdecryptage", url: "{controller}/{action}/{login_crypter}/{mdp_crypter}", defaults: new { controller = "home", action = "decriptidentifiantetredirige", login_crypter = urlparameter.optional, mdp_crypter = urlparameter.optional } );
Comments
Post a Comment