Loading...
  Lost your password? Lost your Username? Make a new account!  
Warez Home  
FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read

Go Back   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.


Reply
 
Thread Tools Display Modes
Old 08-18-2009, 03:24 PM   #1
wisam
Administrator
 
Join Date: Nov 2006
Posts: 163,131
Default 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.
wisam is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
trying to connect to MS SQL from PHP.....no luck, going insane wisam Databases 0 07-30-2009 03:20 PM
Eureka S03E11 Insane In The P-Brane HDTV XviD-FQM gamer99 Games 0 07-25-2009 08:24 AM


eXTReMe Tracker
 
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
   
All times are GMT. The time now is 07:10 PM.  
 
Style by MafiiOso