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
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Rajeesh MenothPosted Apr 5, 2016, 11:58 AM
Shweta LodhaPosted Apr 5, 2016, 10:54 AM
You can use stringbuilder.
foreach (string item in _placeholder)
{
builder.Append(item).Append("|");
}
string result = builder.ToString();
ThrishPosted Apr 5, 2016, 10:50 AM