Problems encountered in asp.net mvc project and solutions ---- ajax request Error 500, multi-table data request, mvc ---- ajax
An Error 500 occurs in ajax requests. However, the function is to divide a page into two parts. Click the right navigation bar and use ajax requests to request data. The corresponding page appears on the right, at that time, partialAction was used and the 500 error was reported, mainly because on this action, one page cannot be called by ajax to request another page. At that time, I was not very familiar with the entity set. For the automatically generated model layer, I thought it could not be changed. So I had to have several controllers to access several tables, so I had to have several actions, it seems that there is no way to achieve this. The final answer is to write another model class, and then add the desired table.
Public class moretable {
Public List <table1> Table1 {get; set ;}
Public List <table2> Tablr2 {get; set ;}
Public moretable (){
Table1 = new List <table1> ();
Table2 = new List <table2> ();
}
} In this way, you can access data in multiple tables.