Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/263.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何循环浏览产品列表并从SchemaWorker在代码隐藏中创建jsonContent?_C#_Asp.net - Fatal编程技术网

C# 如何循环浏览产品列表并从SchemaWorker在代码隐藏中创建jsonContent?

C# 如何循环浏览产品列表并从SchemaWorker在代码隐藏中创建jsonContent?,c#,asp.net,C#,Asp.net,我们正在我们的电子商务主页中实现schema.org。我必须抓取显示在我们主页上的项目列表,并获取这些项目的位置以及这些项目的url。然后我必须从它们创建jsonContent并将其传递到前端 我已经有了schemaworker设置,我只是需要帮助,了解如何循环浏览每个项目并获取所需的详细信息 int collid = Product.GetCollectionID(siteid, "Home Page"); List<Product> list = Product.ProductC

我们正在我们的电子商务主页中实现schema.org。我必须抓取显示在我们主页上的项目列表,并获取这些项目的位置以及这些项目的url。然后我必须从它们创建jsonContent并将其传递到前端

我已经有了schemaworker设置,我只是需要帮助,了解如何循环浏览每个项目并获取所需的详细信息

int collid = Product.GetCollectionID(siteid, "Home Page");
List<Product> list = Product.ProductCollList(collid, siteid);
listProducts.DataSource = list;
listProducts.DataBind();

for (int i = 0; i < list.Count; i++)
{
StringBuilder sbItemListSchema = new StringBuilder();
string jsonConent = SchemaWorker.GetHomePageSchema()
}


ScriptManager.RegisterStartupScript(this.Page, GetType(),Guid.NewGuid().ToString(), sbItemListSchema.ToString(), false);
int collid=Product.GetCollectionID(siteid,“主页”);
列表=Product.ProductCollList(collid,siteid);
listProducts.DataSource=列表;
listProducts.DataBind();
for(int i=0;i