Click here to Skip to main content
15,890,123 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

In my application, i am populating city dropdownlist on state selection through AJAX.

AJAX return dropdown list control and add it to page.

Now if i click on button on same page, it gives me error on Chrome -

The state information is invalid for this page and might be corrupted.


It seems like viewstate issue
In firefox , it works fine

Can anyone guide me?
Posted
Updated 7-May-14 19:51pm
v3

 
Share this answer
 
Comments
Laiju k 7-May-14 3:14am    
does cascading work on ASP.Net 2.0
DamithSL 7-May-14 3:18am    
If you want to incorporate ASP.NET AJAX features in the .NET Framework 2.0, you must have ASP.NET 2.0 AJAX Extensions 1.0 installed
[no name] 7-May-14 3:31am    
ok. thank you for reply. means in any way i have to create web service?
[no name] 7-May-14 3:37am    
Use ajax it is the best method....
[no name] 7-May-14 5:21am    
but in ajax, we get response in string format. how can we populate dropdown list?
this is only a sample..........

PHP
function setAutoCompleteProc() {
        $nc2("#txtitem").autocomplete({
            minLength: 2,
            source: "../Forms/getdataService.aspx?Id=0; + Math.random(),
            focus: function (event, ui) {
                $nc2(this).val(ui.item.NAME);
                return false;
            },
            select: function (event, ui) {
                $nc2(this).val(ui.item.NAME);
                return false;
            }
        });



here in getdataService.aspx a function retrieves dropdown items , onfocus of that text box call the js function
 
Share this answer
 
Hi,
You can do the same thing without using CascadingDropDown.

Check this tutorial :
https://www.youtube.com/watch?v=9g2h0RFL5sA[^]
 
Share this answer
 
Comments
[no name] 8-May-14 1:43am    
ok. thank you for the link.
I have done that with ajax but now i am getting error on button click -
The state information is invalid for this page and might be corrupted.
Dilan Shaminda 8-May-14 3:48am    
when you get that error? when OnSelectedIndexChanged of dropdwonlist fires? And i was really confused, because the question topic and details has been modified..When someone came here to find some answers by looking at the new topic they would be confused too.I don't think that changing question for same thread is nice...
[no name] 8-May-14 6:54am    
ok sorry for that. from next time i will post new question. i get error on button click.<br>
i mean after state and city selection, i click asp.net button.
on click , it displays error.

In firefox, it does not give error but is hide ajax returned control
Dilan Shaminda 8-May-14 8:40am    
set page parameter EnableEventValidation to false.
<%@ Page EnableEventValidation="false"

http://w3ka.blogspot.com/2008/04/ajax-error-messagethe-state-information.html

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900