Server Error in '/' Application. (Event validation is enabled using in configuration or <%@ Page EnableEventValidation="true" %> in a page)

Posted by Snaini under ASP.NET category on | Points: 40 | Views : 342
Hi , when ever your getting (Server Error in '/' Application) this type of errors.
Do not change like Event validation is enabled using <pages enableEventValidation="false"/> in configuration or <%@ Page EnableEventValidation="false" %> in a page.
Example: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Details.aspx.cs" Inherits="EntityModelCRUD.Views.Details" EnableEventValidation="false" %>
"It is a bad practice"

Better to do like: UseSubmitBehavior="false",
<asp:GridView ID="grd" runat="server" OnRowEditing="grd_RowEditing" CellPadding="6" ForeColor="#333333" GridLines="None" AutoGenerateColumns="false" AlternatingRowStyle-BackColor="#6699ff" AlternatingRowStyle-ForeColor="Red">

<asp:TemplateField HeaderText="CRUD">

<asp:Button ID="ButtonEdit" runat="server" CommandName="Edit" Text="Edit" UseSubmitBehavior="false" />
<asp:Button ID="ButtonDelete" runat="server" CommandName="Delete" Text="Delete" UseSubmitBehavior="false" />

Comments or Responses

Login to post response