Hi,
This is my view :
protected void ButtonSave_OnClick(object sender, EventArgs e)
{
List _placeholder = (List)Session["listPlaceholder"];
OrdersModel order = new OrdersModel();
order.UserID = (int)Session["userId"];
order.TemplateID = (int)Session["TemplateID"];
order.Price = ((List)Session["SelectedAddress"]).Count * 1;
var address = (List)Session["SelectedAddress"];
_orderBL.ConfirmOrder(address, _placeholder,order);
}
and this is my Business Layer :
public string ConfirmOrder(string address, string _placeholder, OrdersModel order)
{
try
{
OrdersDL _ordersDL = new OrdersDL(); // Creating object of Dataccess
return _ordersDL.ConfirmOrder(address,_placeholder,order); // calling Method of DataAccess
}
catch
{
throw;
}
}
But here shows error like cannot convert list to string
Please help me.
Thanks


Thrish53 reputationPosted Apr 5, 2016, 6:50 AM EDT
Shweta LodhaRank #31 · 39.8K reputationPosted Apr 5, 2016, 6:54 AM EDT
You can use stringbuilder.
foreach (string item in _placeholder)
{
builder.Append(item).Append("|");
}
string result = builder.ToString();
Rajeesh MenothRank #118 · 18.4K reputationPosted Apr 5, 2016, 7:58 AM EDT