By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,312 Members | 1,280 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,312 IT Pros & Developers. It's quick & easy.

Repeater Control Header Template Problem

P: 5
Hi All,

I am stucked with a problem , regarding Repeater Controls Header Template.
I want to show a Image Button in the Header Template of a Repeater Control and on the Click of that button, I would like to show one small Pop-up window.
Now , problem here is that , How to catch the event generated by the Image Button?

The Header Template looks like ....
<HeaderTemplate>
<table border = 0>
<tr>
<th> Name </th>
<th> ID </th>
<th> Dept</th>
<th>
<asp:ImageButton ID="ImageButton1" CommandName="update" runat="server" />
</th>
</tr>
</HeaderTemplate>
Now , whenever I click on Image Button , some Server Error is shown,

Error is like,

Server Error in '/RepeaterCtrl' 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.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: 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.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Please, Can anybody Help me? Does anybody knows anything about this?
Jul 13 '07 #1
Share this Question
Share on Google+
2 Replies


nateraaaa
Expert 100+
P: 663
Hi All,

I am stucked with a problem , regarding Repeater Controls Header Template.
I want to show a Image Button in the Header Template of a Repeater Control and on the Click of that button, I would like to show one small Pop-up window.
Now , problem here is that , How to catch the event generated by the Image Button?



Now , whenever I click on Image Button , some Server Error is shown,

Error is like,



Please, Can anybody Help me? Does anybody knows anything about this?
I did several searches on this topic and it seemed that this is a common problem for many 2.0 users. The quick fix is to set EnableEventValidation="false" at the page level or <pages enableEventValidation="false"/> in the web.config. There was also another idea that involved databinding the grid in the !IsPostBack of the PageLoad event. For more information on this please see this site .

I hope this helps solve your problem

Nathan
Jul 13 '07 #2

P: 5
I did several searches on this topic and it seemed that this is a common problem for many 2.0 users. The quick fix is to set EnableEventValidation="false" at the page level or <pages enableEventValidation="false"/> in the web.config. There was also another idea that involved databinding the grid in the !IsPostBack of the PageLoad event. For more information on this please see this site .

I hope this helps solve your problem

Nathan

Thanks Nathan for ur Reply.

I already did EnableEventValidation="false".
What I want to know was , is there any other way?
Becuase , Turning off EnableEventValidation for whole page is not a good Idea.

But, I must admit, that the link given by u , helped me alot to understand this problem much better.

Thanks Again.
Jul 17 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.