如何在以下方法中使用网格视图控件
public static string ServerSideMethod()
{
strSend = "File uploaded sucessfully";
Database db = new Database();
db.Add(name);
GridView1.DataSource = db.LoadCourses();//showing error
GridView1.DataBind(); //showing error
}
return strSend;
}
我下面的脚本调用 ServerSideMethod
$.ajax(
{
type: "POST",
contentType: "application/json; charset=utf-8",
url: "UploadResx.aspx/ServerSideMethod",
data: "{ sendData: 'ok' }",
success: function (result) {
alert(result.d);
}
})
请让我知道如何刷新 GridView1