我正在使用幻灯片扩展器动态创建幻灯片。我的网络服务代码是:-
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
AjaxControlToolkit.Slide[] slides = new AjaxControlToolkit.Slide[tblData.Tables[Count_w].Rows.Count];
for (int i = 0; i < tblData.Tables[Count_w].Rows.Count; i++)
{
DataRow dr = tblData.Tables[Count_w].Rows[i];
slides[i] = new AjaxControlToolkit.Slide(dr["imgurl"].ToString(), dr["header"].ToString(), dr["descr"].ToString());
}
Count_w++;
return slides;
}
关于为什么会发生这种情况的任何线索。我曾尝试在 Web 服务中包含硬编码并且它有效。工作代码: -
[System.Web.Services.WebMethod]
[System.Web.Script.Services.ScriptMethod]
public static AjaxControlToolkit.Slide[] GetSlides()
{
return new AjaxControlToolkit.Slide[] {
new AjaxControlToolkit.Slide("Help/1.png", "Add new server", "Login on server"),
new AjaxControlToolkit.Slide("Help/2.png", "Add new server", "Login success"),
new AjaxControlToolkit.Slide("Help/3.png", "Add new server", "Create new user"),
new AjaxControlToolkit.Slide("Help/4.png", "Add new server", "Test user")};
return slides;
}
谁能告诉我为什么动态人口不起作用。两种方法都返回相同的结果。