我不认为 [HttpPost]
控制器应该在 GET 中
public ActionResult FillFS(AFViewModel ViewModel)
{
try
{
//Execute the SP
var TextBoxList = GetListOfTextBox("somevar","somevar2");
//Code to populate
//ViewModel.TextBox1 && ViewModel.TextBox2
}
catch (Exception ex)
{
Response.Write(ex.InnerException.Message);
}
return PartialView("_AFTab");
}
这里我只是包装了函数导入。
public static List<SPResult> GetListOfTextBox(string varchar1, string, varchar2)
{
using (var db = new EDMXEntities())
{
//GetTextBoxValue is the name you gave to the function import
ObjectResult<SPResult> Results = db.GetTextBoxValue(varchar1, varchar2);
List<SPResult> results = Results.ToList();
return results;
}
}
希望这会有所帮助