1
Answer

Solution To run Time error


Hello,
          I have used multiview control and in that i used grid view and formview. I am using objectdatasource to fill the data.
     While i am editing at first time i didn get any problem. After that again i clicked on edit button of grid. At that i a getting the following error. 
Error: Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.
Please tell me the solution. It is urgent.
 
Thanks,
Answers (1)
2
Prakash Reddy

Prakash Reddy

NA 201 14 8y
In asp.net
put the text box in gridview and bind data to text box and put default enabled="false"; 
in each text box
In c#

private void OnKeyDownHandler(object sender, KeyEventArgs e)   
      {            
if (e.KeyCode == Keys.Enter)
{
//enabletextbox here
//textbox1.enabled="true";
}
   }
0
Joseph K

Joseph K

NA 205 10.4k 8y
Hi Prakash,
               Thanks for your reply.I am using ASP.Net gridview.Is there class is there for keyeventargs?