This is a migrated thread and some comments may be shown as answers.

Error message

3 Answers 121 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Phillip
Top achievements
Rank 1
Phillip asked on 25 Feb 2011, 12:31 AM
Guys, I have a     RadGrid where I embedded an image button. When I click the button this is what I got. How can I resolve that?

 

Server Error in '/AJAXCTS' Application.

Invalid postback or callback argument.  Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@ Page EnableEventValidation="true" %> in a page.  For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them.  If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

3 Answers, 1 is accepted

Sort by
0
Tsvetina
Telerik team
answered on 02 Mar 2011, 10:29 AM
Hi Phillip,

There is a number of reasons why this could happen, so it would help us give you some ideas if you share your grid related mark-up and code-behind, along with any AJAX settings if you are using AJAX for the grid.

Greetings,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Phillip
Top achievements
Rank 1
answered on 03 Mar 2011, 05:51 AM
If I put  EnableEventValidation="false" in the page, it does not blow up but still having the problem of not firing if I click the embedded button.

Below is the source code

<%

 

@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="MyCaseLoad.aspx.cs" Inherits="Pages_MyCaseLoad" EnableEventValidation="false"

%>

 

 

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat

="Server">

 

<style type

="text/css">

 

.style1

 

 

 

 

{

 

 

width: 100%

;

 

}

 

 

.style2

 

 

{

 

 

 

 

font-size: large

;

 

 

 

 

font-weight: bold

;

 

 

}

 

</

 

 

style

>

 

 

 

</

 

 

 

 

 

asp:Content

>

 

 

 

<

 

 

 

 

 

asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat

="Server">

 

 

 

 

 

<table class

="style1">

 

 

 

 

 

<tr

>

 

 

 

 

 

<td class="style2" style="text-align

: center">

 

 

 

My Case Load

 

</td

>

 

 

 

 

 

</tr

>

 

 

 

 

 

<tr

>

 

 

 

 

 

<td

>

 

 

 

 

 

<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"

 

 

 

 

 

 

 

AllowSorting="True" ShowGroupPanel="True"

 

 

 

 

 

 

 

AutoGenerateColumns="False" Width="100%" ShowStatusBar="True" Skin="Black"

 

 

 

 

 

 

 

onitemcommand="RadGrid1_ItemCommand"

 

 

 

 

 

 

 

onselectedindexchanged="RadGrid1_SelectedIndexChanged" GridLines="None"

 

 

 

 

 

 

 

onitemdatabound

="RadGrid1_ItemDataBound">

 

 

 

 

 

<ClientSettings AllowDragToGroup

="True">

 

 

 

 

 

<Selecting AllowRowSelect="True"

/>

 

 

 

 

 

</ClientSettings

>

 

 

 

<

 

 

 

 

 

MasterTableView DataKeyNames="CrimeID" GridLines

="Both">

 

 

 

<

 

 

 

 

 

CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings

>

 

 

 

<

 

 

RowIndicatorColumn FilterControlAltText

="Filter RowIndicator column">

 

 

 

</

 

 

 

 

 

RowIndicatorColumn

>

 

 

 

<

 

 

ExpandCollapseColumn FilterControlAltText

="Filter ExpandColumn column">

 

 

 

</

 

 

 

 

 

ExpandCollapseColumn

>

 

 

 

 

 

<Columns

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="PersonID"

 

 

 

 

 

 

 

FilterControlAltText="Filter column2 column" HeaderText="Person ID"

 

 

 

 

 

 

 

UniqueName="column2" Visible

="False">

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="CrimeID"

 

 

 

 

 

 

 

FilterControlAltText="Filter column column" HeaderText="Case ID"

 

 

 

 

 

 

 

UniqueName

="column">

 

 

 

 

 

<HeaderStyle Width="7%"

/>

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="District"

 

 

 

 

 

 

 

FilterControlAltText="Filter column1 column" HeaderText="District"

 

 

 

 

 

 

 

UniqueName

="column1">

 

 

 

 

 

<HeaderStyle Width="10%"

/>

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="crimetype"

 

 

 

 

 

 

 

FilterControlAltText="Filter column6 column" HeaderText="Crime Type"

 

 

 

 

 

 

 

UniqueName

="column6">

 

 

 

 

 

<HeaderStyle Width="20%"

/>

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="Person"

 

 

 

 

 

 

 

FilterControlAltText="Filter column3 column" HeaderText="Name"

 

 

 

 

 

 

 

UniqueName

="column3">

 

 

 

 

 

<HeaderStyle Width="20%"

/>

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

<telerik:GridBoundColumn DataField="status"

 

 

 

 

 

 

 

FilterControlAltText="Filter column7 column" HeaderText="Status"

 

 

 

 

 

 

 

UniqueName

="column7">

 

 

 

 

 

<HeaderStyle Width="30%"

/>

 

 

 

 

 

</telerik:GridBoundColumn

>

 

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName

="ImageButton">

 

 

 

 

 

<ItemTemplate

>

 

 

 

 

 

<asp:ImageButton ID="btnPerson" runat="server" ToolTip="Photo Available" CommandName="Persons" ImageUrl="../Images/icon_hostusers_16px.gif"

/>

 

 

 

 

 

</ItemTemplate

>

 

 

 

 

 

</telerik:GridTemplateColumn

>

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName ="btnEdit"

>

 

 

 

 

 

<ItemTemplate

>

 

 

 

 

 

<asp:ImageButton ID="btnUpdate" runat="server" ToolTip="Update Case" CommandName="Update" ImageUrl="../Images/action_settings.gif"

/>

 

 

 

 

 

</ItemTemplate

>

 

 

 

 

 

</telerik:GridTemplateColumn

>

 

 

 

 

 

<telerik:GridTemplateColumn UniqueName ="btnUpdate"

>

 

 

 

 

 

<ItemTemplate

>

 

 

 

 

 

<asp:ImageButton ID="btnNote" runat="server" ToolTip="Available Notes"

 

 

 

 

 

 

 

CommandName="Notes" ImageUrl="../Images/about.gif"

/>

 

 

 

 

 

</ItemTemplate

>

 

 

 

 

 

</telerik:GridTemplateColumn

>

 

 

 

 

 

 

</Columns

>

 

 

 

<

 

 

EditFormSettings

>

 

 

 

<

 

 

 

 

 

EditColumn FilterControlAltText

="Filter EditCommandColumn column">

 

 

 

 

</

 

 

EditColumn

>

 

 

 

</

 

 

 

 

 

EditFormSettings

>

 

 

 

</

 

 

 

 

 

MasterTableView

>

 

 

 

<

 

 

PagerStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 

 

 

Font-Strikeout

 

 

="False" Font-Underline="False" HorizontalAlign="Right"

 

 

 

Wrap

 

 

="True"

/>

 

 

 

<

 

 

HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"></HeaderContextMenu

>

 

 

 

 

 

</telerik:RadGrid

>

 

 

 

 

 

</td

>

 

 

 

 

 

</tr

>

 

 

 

</

 

 

 

 

 

table

>

 

 

 

</

 

 

 

 

 

asp:Content

>

 

 

 

 

0
Tsvetina
Telerik team
answered on 08 Mar 2011, 11:57 AM
Hello Phillip,

I could not see any obvious mistakes in your code. Do you have AJAX controls in your MasterPage and what do they update. Additionally, do any controls from the master or other content pages interact with the grid in the page that you pasted the mark-up for?

In order to help you get a better idea of what you should be looking for, here is what MSDN says about when such exception is thrown:
When the EnableEventValidation property is set to true, ASP.NET validates that a control event originated from the user interface that was rendered by that control. A control registers its events during rendering and then validates the events during postback or callback handling. For example, if a list control includes options numbered 1, 2, or 3 when the page is rendered, and if a postback request is received specifying option number 4, ASP.NET raises an exception. All event-driven controls in ASP.NET use this feature by default.


All the best,
Tsvetina
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Tags
General Discussions
Asked by
Phillip
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
Phillip
Top achievements
Rank 1
Share this question
or