views:

308

answers:

2

Once I click the button, it throws a "Validation of viewstate MAC failed" exception. I know MVC does not support PostBack but is there any way to work around this?

Or we need to use HtmlHelper in MVC?

Below is my code in View:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

<form id="form1" runat="server">

<h2>Hello World</h2>

<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<br />
<br />

<asp:Button ID="Button1" runat="server" Text="Button" />

</form>

</asp:Content>
+6  A: 

Don't fight your framework - if you want to use ASP.NET MVC, then go ahead and use it but create controls using the tools of the framework.

If you want or need to use postback controls then you really ought to stick with regular old ASP.NET.

Andrew Hare