Postback and RegisterForEventValidataion

  • Thread starter Thread starter SECSteve
  • Start date Start date
S

SECSteve

I am working with a radio button group. Depending on the seleciton panels
and controls will show/hide. I keep getting an Invalid Postback or Callback
argument. I have tried registering the values that I am using in render()
with ClientScript.RegisterForEventValidation but it is not working.

The buttong group only has 2 choices. At load choice #1 is selected. I can
select #2 and the proper events happen. However, if I go back to choice #1
I get the error. I have not found a satisfactory solution on the web.

Any ideas?
 
Here's a little more info that might help. All of these controls are in an
update panel. 1 of the controls that appears during the SelectedIndexChaned
event of the radio button is a drop down that is populated from a database.
If I comment out the code that populates the drop down everything works ok,
I don;t get the error.

This makes me thingk that I have to use the render()
ClientScript.RegisterForEventValidation for every value in that drop down.

How do I do that for a dynamically populated control???

Is there a better way, somethging that I am missing? After all, I am pretty
new to this.


Thanks.
 
Hello,

DropDownList should register it's values for event validation already. Is it
sure that you aren't databinding it on every request?

Could you provide a relevant snippet of your code (feel free to email me
directly), so I can take a look at it.
 
Hi SECSteve,

Welcome to MSDN Managed Newsgroup!

Without complete code listing, my wild guess of your issue is the same as
described in this blog:

#Joe Stagner - Frustrated by Design ! : ASP.NET AJAX Postback Event
Validation
http://blogs.msdn.com/joestagner/archive/2007/08/14/asp-net-ajax-postback-ev
ent-validation.aspx

For AJAX Postback event validation, you're right that you need to call
RegisterForEventValidation for each value in the DropDownList, even they're
retrieved from the database.

Please feel free to let me know if I've misunderstood anything.


Sincerely,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi SECSteve,

I'm wondering if you have seen my last reply. Our policy is to follow-up
each post within 48 business hours and we need to confirm with customer
before closing a post. Since I don't have complete information for your
question, my last reply asked for more information. Would you please let me
know more about your question? Thanks.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top