Try this code.
public ActionResult Create(int ReceiptId,PaymentPaidViewModel.detail details)
{
if(details != null)
{
if (details.idSelected == false)
{
var result = PaymentPaidViewModel.TotaltobePaid(ReceiptId);
return View(result);
}
else if (details.idSelected == true)
{ ----- }
}
else
{
return View(ReceiptId);
}
}