foreach (string id in str1)
{
string logoImage = "";
string BundleID = id;
BundleSearchResultStruct BundleSearchResult = nbsi.GetProductDetails(guid, "marketingPartnerPassword", Convert.ToInt32(BundleID));
string y = builder1.Append(BundleSearchResult).Append(",").ToString();
y = y.TrimEnd(',');
Session["BundleSearchResult"] = y;
//some code relevent only to this block
}
while (reader1.Read())
{
//do something
foreach (string id in str1)
{
string logoImage = "";
string BundleID = id;
//BundleSearchResultStruct bsr2 = nbsi.GetProductDetails(guid, "marketingPartnerPassword", Convert.ToInt32(BundleID));
string bsr = Session["BundleSearchResult"].ToString();
string[] bsr1 = bsr.Split(',');
foreach (string bsr2 in bsr1)
{
System.Web.UI.HtmlControls.HtmlGenericControl dynDiv = new System.Web.UI.HtmlControls.HtmlGenericControl("DIV");
li.Controls.Add(dynDiv);
Type type = bsr2.GetType();
PropertyInfo senderproperty = type.GetProperty(reader1["XmlName"].ToString());
object PropertyValue = senderproperty.GetValue(bsr2, null);
string Nodetype = reader1["Type"].ToString();
string XmlName = reader1["XmlName"].ToString();
dynDiv.Attributes.Add("class", "block1");
if (Nodetype == "Pound")
{
if (Convert.ToDecimal(PropertyValue.ToString()) > 0)
{
dynDiv.InnerText = String.Format("{0:C}", PropertyValue.ToString());
}
else
{
dynDiv.InnerText = "Free";
}
}
}
here in my application in the first
BundleSearchResult = nbsi.GetProductDetails(guid, "marketingPartnerPassword", Convert.ToInt32(BundleID));
i am calling an API....i need to use the object in BundleSearchResult in the second foreach (string id in str1)...so i have used the session to get the objects..
but the prob is at Type type = bsr2.GetType(); the type should be the class but i am getting as string..so what to do..