Here is my default.aspx:
<body>
<form id="form1" runat="server">
<div>
<asp:GridView ID="GridView1" runat="server">
</asp:GridView>
</div>
</form>
</body>
cs:
protected void Page_Load(object sender, EventArgs e)
{
ShopifyAuthorizationState state = HttpContext.Current.Session["Shopify.AuthState"] as ShopifyAuthorizationState;
ShopifyAPIClient client
= new ShopifyAPIClient(state);
string shopData = (string)client.Get("/admin/products.json");
JavaScriptSerializer serializer = new JavaScriptSerializer();
// Here Product is a object class which contains all of the attribute that JSON has
var model = JsonConvert.DeserializeObject<RootObject>(shopData);
List<Product> lstProduct = serializer.Deserialize<List<Product>>(shopData);
GridView1.DataSource = lstProduct;
GridView1.DataBind();
}
public class Product
{
public long id{ get; set; }
public string title{ get; set; }
public string body_html { get; set; }
}
I m new to .net.
When i run below code, it shows error like this,
Could not load type 'System.Reflection.IntrospectionExtensions' from assembly 'System.Reflection, Version=4.0.0.0, Culture=neutral, PublicKeyToken=..'
But i already added system.reflection.dll
Still it shows error,.
Can anyone help me to fix this?
Any help would be highly appreciated.
Thanks in advance.
Aucun commentaire:
Enregistrer un commentaire