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

[Solved] Invalid postback or callback argument in command item template

6 Answers 326 Views
Grid
This is a migrated thread and some comments may be shown as answers.
mathieu
Top achievements
Rank 1
mathieu asked on 19 Mar 2013, 04:18 PM
HI,

I read a lot of articles about this problem but none answer my case :-(

So here is my problem:

I have a complex page with several user control and when i click on the linkbutton (or button) of the commanditemTemplate :
<CommandItemTemplate>
    <table class="rgCommandTable" border="0" style="width:100%;">
        <tr>
            <td style="text-align: left">
                <asp:Panel ID="MakeLotDistribution" runat="server">
                    <asp:Button ID="MakeLotDistributionButton" runat="server" CausesValidation="False" title="Faire un lot de distribution" CommandName="InitInsert" class="rgAdd" OnClientClick="if (!checkIfSelected(this)) return;" />
                    <asp:LinkButton ID="MakeLotDistributionlien" runat="server" CausesValidation="False" Text="Faire un lot de distribution" CommandName="InitInsert" OnClientClick="return checkIfSelected(this);" />
                </asp:Panel>
            </td>
            <td style="text-align: right">
                <asp:Button ID="RefreshButton" runat="server" Text=" " title="Rafraîchir" class="rgRefresh" />
                <asp:LinkButton ID="RebindGridButton" runat="server" CausesValidation="False" >Rafraîchir</asp:LinkButton>
            </td>
        </tr>
    </table>
</CommandItemTemplate>

I get this error in the javascript console:
Uncaught Sys.WebForms.PageRequestManagerServerErrorException: Sys.WebForms.PageRequestManagerServerErrorException: 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.

i tried to add :

protected override void OnInit(EventArgs e)
{
    RadScriptManager.GetCurrent(this.Page).RegisterPostBackControl(this.DistributionItemGrid);
}

with this line i don't have the exception but that process a full postback and so the first radgrid is collapse..
i also tried with RegisterAsyncPostBackControl but i get the error like if there was nothing

here is the full hierarchy, i use dotnetnuke so i can't change the page validation
ascx ->
ascx -> radAjaxPanel -> radMultipage -> RadPageView ->
ascx -> radgrid -> Nesteviewtemplate -> 
ascx ->  radAjaxPanel -> radMultipage -> RadPageView ->
ascx -> RadAjaxPanel -> radgrid ->
 CommandItemTemplate -> LinkButton

Thank you very much for your time :-)

6 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 22 Mar 2013, 03:30 PM
Hi Mathieu,

Based in the information provided it would be hard to determine what is causing this issue. Maybe the problem is DNN-related. To identify this, can you please check whether moving the grid outside of the DotNetNuke environment makes a difference? 

If the issue persists only in DNN, I suggest you to post your question in the DotNetNuke forums or contact the support of DNN for technical help with our products.

All the best,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 22 Mar 2013, 03:54 PM
i already check this but it change nothing it's not related to DNN
0
Angel Petrov
Telerik team
answered on 27 Mar 2013, 04:26 PM
Hi Mathieu,

I am afraid that without a sample page in which the problem successfully replicates it would be hard to determine what is the root cause of the problem. Could you please provide additional code that could help us in reproducing the issue? Also please give us more information about your scenario.

Greetings,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 27 Mar 2013, 07:09 PM
thanks i'll try to do that 
0
Angel Petrov
Telerik team
answered on 01 Apr 2013, 11:30 AM
Hi Mathieu,

I am waiting on your reply. Let us know if you have additional information on the subject.

Regards,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
mathieu
Top achievements
Rank 1
answered on 03 Apr 2013, 06:02 PM
hi,

thanks for the follow up,

but i'm sorry i currently don't have the time to export the code from my environment (DNN, my user control, DAL, etc) to send you a running project with the problem.

i found a workaround, in fact i figure out that the functionnality wasn't essential because i'n in a rush i supress the button that cause me the trouble so overkill the problem :-)

thanks
Tags
Grid
Asked by
mathieu
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
mathieu
Top achievements
Rank 1
Share this question
or