Loading...
  Lost your password? Lost your Username? Make a new account!  
Warez Home  

  Warez Home > .NET

.NET Microsoft's next generation development platform brings many new features. Learn how to use the ASP.NET languages and components effectively and efficiently.


 
Thread Tools Display Modes
08-18-2009, 04:24 PM   #1
wisam
Administrator
 
: Nov 2006
: 63,959
Asp.net MVC - about to go insane

O.k. seems simple and maybe it's staring me in the face but I have spent time on my objects, nhibernate persistence with repositories and so on and I get to what I think is going to be the simple part creating the mvc project. Right now I have a login form in a basic Login view:-

Code:
Login








Your Login Details

Username:





Password:












The code in the controller:-

Code:
[AcceptVerbs(HttpVerbs.Get)]
public ViewResult Login()
{
return View();
}

[AcceptVerbs(HttpVerbs.Post)]
public ViewResult Login(string username, string password)
{

CmasUser u = _adminService.GetUserByUsername(username, password);

//if (u.LoginSuccessful)
//{
// return View("Users");
//}
TempData["LoginMsg"] = u.LoginStatus;
return View();
}
I can step through all of this and show that the code is being called but the problem is the username is what I have entered first time around and is forever after. i.e. I enter boconnell which does not exist and I correctly get a "Username not found!" message on the view. I then enter boconnell6 which I know to exist (because if I stop and start again with boconnell6 the username is found) and the controller action receives boconnell again and again and again. Basically the first value entered and posted will forever more be the value in that textbox.

I've been struggling to debug this. I stepped into the global.asax where the controller is created using Rhino Commons:-

Code:
public class RhinoIoCControllerFactory : IControllerFactory
{

public IController CreateController(RequestContext requestContext, string controllerName) {
return IoC.Resolve((controllerName + "Controller").ToUpper());
}

public void ReleaseController(IController controller) {
IoC.Container.Release(controller);
}

}
This runs every time a controller is requested and I can see by expanding the requestContext while debugging that the form collection contains "boconnell" so I am truly at a loss. I really hate when something so simple brings everything to a halt. Anyone out there got any ideas. Maybe it is something simple I have completely misssed.
  Reply With Quote

Bookmarks

Thread Tools
Display Modes





Similar Threads
thread
trying to connect to MS SQL from PHP.....no luck, going insane wisam Databases 0 07-30-2009 04:20 PM
Eureka S03E11 Insane In The P-Brane HDTV XviD-FQM gamer99 Games 0 07-25-2009 09:24 AM


 
   
  
 
Style by MafiiOso