i did two listbox and value swap by using Input sumbit type(Html tag) onclick event of Jquery..values are easy to swap from 1 listbox to another but when i go for store selected value from listbox so selected value given me.. First i got error Page Eventvalidation=true so i searched on google and solve this problem by using
protected override void Render(System.Web.UI.HtmlTextWriter writer)
{
Page.ClientScript.RegisterForEventValidation(lsttolimo.UniqueID,this.ToString());
base.Render(writer);
}
yet solution is not found. than after i was used UpdatePanel and add Each of The Controls in Triggers but still Solution is not found
First let's understand what the EventValidation means in the world of .NET.
When you create some server controls, then should be rendered into HTML, so that they can be shown in the browser. Now, consider that you have 10 items in a DropDownList. Those 10 items would be rendered as
<option>
tags inside<select>
tag (they are converted to HTML equivalent control).Now, ASP.NET encrypts those 10 values, and adds them to the
EventValidation
hidden field too. This means that you now have sent those 10 values TWO TIMES to the browser. Now, whenever somebody posts back the form, ASP.NET gets the posted value (one of those 10 items is posted back). It then decrypts those 10 encrypted values (now it has 10 + 1 values). It checks to see if the posted value is one of the 10 items or not. If it is, then ASP.NET gets sure that everything is OK. But if it's not, then it understands that somebody has tried to fool it.Now, consider for example that you have a list of countries, and you only accept users from 3 countries, say for example, US, England, and Australia. However, someone comes to your registration page, understands the HTML and creates another form with the same fields and the same list of countries. But this time he also adds the name of another country to your list (say Iran).
If you don't have EventValidation turned on, and you don't explicitly check for the country, then you're simply fooled into accepting Iran as a valid country. This is called form spoofing.
Now, since you have two lists, and you swap their values, of course, .NET thinks that it's getting fooled. I recommend that you turn off the EventValidation (this is the easier way, but more prone to security problems) and check it yourself.
To turn off event validation, simply add this to your web.config file: