I'm Trying to call Partial View Into view i want to call parameterized method which is returing the partial view so how to call it.
My code is below.
View
@{Html.RenderPartial("~/Views/Appoinment/GetALLAppoinmentMedicine.cshtml",
new List<HMS.Models.AppointmentViewModel> { new HMS.Models.AppointmentViewModel() },
new ViewDataDictionary { { "aid", Model.AppoinmentIDP} });}
Controller
public ActionResult GetALLAppoinmentMedicine(int aid)
{
var idParam = new SqlParameter
{
ParameterName = "APPIDP",
Value = aid
};
var SpResult = DB.Database.SqlQuery<AppointmentViewModel>("exec uspAppoinmentMedicine_GetAll @APPIDP", idParam).ToList<AppointmentViewModel>();
IEnumerable<AppointmentViewModel> Result = SpResult.Select(s => new AppointmentViewModel
{
MadicineName = s.MadicineName,
PotencyName = s.PotencyName,
SizeofPills = s.SizeofPills,
Dose = s.Dose,
DoseType = s.DoseType,
Repitation = s.Repitation,
Quantity = s.Quantity,
Duration = s.Duration
});
return View(Result);
}