Correct usage for Page.ClientScript.RegisterForEventValidation
<p>i have the following method in a usercontrol</p>

<pre><code>    protected override void Render(HtmlTextWriter writer)
    {
        base.Render(writer);

        Page.ClientScript.RegisterForEventValidation(DataList1.UniqueID);
        if (DataList1.Items.Count &gt; 0)
        {
            foreach (DataListItem item in DataList1.Items)
            {
                Page.ClientScript.RegisterForEventValidation(item.UniqueID);
                foreach (Control ctrl in item.Controls)
                {
                    if (ctrl is Button)
                    {
                        Button btn = ctrl as Button;
                        Page.ClientScript.RegisterForEventValidation(btn.UniqueID, btn.CommandArgument);
                    }
                }
            }
        }
    }
</code></pre>

<p>I'm trying to get the page to stop giving me the "Invalid postback or callback argument.  Event validation is enabled using  in configuration or &lt;%@ Page EnableEventValidation="true" %> in a page" error when a selection is made (button is clicked with databound command argument) in the Datalist. i've tried to register the event validation for the submit control, but i can't get it working.</p>

<p>Anyone had any sucess using this method? I really don't want to disable the event validation for the page.</p>
