Button Onclick event (which is in codbehind) doesn't get triggered in MVC 2

Posted by rksprst on Stack Overflow See other posts from Stack Overflow or by rksprst
Published on 2010-05-04T18:08:58Z Indexed on 2010/05/04 18:28 UTC
Read the original article Hit count: 277

I had an MVC 1.0 web application that was in VS 2008; I just upgraded the project to VS 2010 which automatically upgraded MVC to 2.0.

I have a bunch of viewpages have codebehind files that were manually added. The project worked fine before the upgrade, but now the onclick even't don't get triggered.

I.e. I have an asp:button with an onclick event that points to a method in the codebehind. When you click the button, the onclick event doesn't get triggered. In fact, when you look at the Page variable, IsPostBack is false.

This is really bizarre and I'm wondering if anyone know what happened and how to fix it. I'm thinking it has something to do with the changes in MVC 2.0; but I'm not sure.

Any help is really appreciated, I've been trying to figure this out for a while.

(deleting the codebehinds and moving that to the controller is not really an option since there is so many pages, moving back to vs 2008 is a last resort as I want to make use of some of the VS 2010 features like performance testing.)

© Stack Overflow or respective owner

Related posts about c#

Related posts about asp.net-mvc