我有一个aspx ListView,我想从服务器端更改数据。这是用于调用API的不完整代码,数据来自
protected async void ButtonZoek_Click(object sender, EventArgs e)
{
string vanRadius = "";
if (hiddenVan.Value != "")
{
if (hiddenVan.Value.Contains("POINT"))//als er een geometry point wordt meegegeven
{
vanRadius = "PN|" + hiddenVan.Value + "|" + radius.Text;
}
}
//ListView1.DataSourceObject =
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("http://localhost:26454/api/Kandidaten/JsonKanRadius");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/plain"));
HttpResponseMessage response = await client.GetAsync("?vanRadius=" + vanRadius);
string kandidaten = await response.Content.ReadAsStringAsync();
}
}
代码不完整,因为我不知道如何将结果中的数据传递给ListView。
如果我的问题不清楚或不完整,请告诉我。