Having trouble in returning to view by passing model along with this.
errorMessage
Cannot bind source type eCaptis.Models.Patient to model type Umbraco.Core.Models.PublishedContent.IPublishedContent.
public class PatientController : SurfaceController
{
public ActionResult Edit(int? id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Patient patient = db.Patients.Find(id);
if (patient == null)
{
return HttpNotFound();
}
return PartialView( patient);
}
}
I possibly suspect there is problem with the routing, as after installing Umbraco v8, Debugger is not hitting RouteConfig.cs
Bit of BackGround:
I have created a document type in umbraco called home which has a child item edit and login
Home page will display a table where by clicking on name it should navigate to edit patient view, so i have passed Id of the patient to controller upon clicking the name of patient as shown in the code above.
Routing or Model binding
Hi Guys,
Having trouble in returning to view by passing model along with this.
errorMessage Cannot bind source type eCaptis.Models.Patient to model type Umbraco.Core.Models.PublishedContent.IPublishedContent.
I possibly suspect there is problem with the routing, as after installing Umbraco v8, Debugger is not hitting RouteConfig.cs
Bit of BackGround: I have created a document type in umbraco called home which has a child item edit and login
Home page will display a table where by clicking on name it should navigate to edit patient view, so i have passed Id of the patient to controller upon clicking the name of patient as shown in the code above.
Doing this my url is changing from http://localhost:12345 to http://localhost:12345/umbraco/Surface/Patient/Edit/345
In general if we dont use surface controller or Umbraco this url could be like http://localhost:12345 to http://localhost:12345/Patient/Edit/345
I have even looked into route hijacking but this did not help me or may be because of my lack of understanding.
Any help in fixing this is much appreciated Thanks in advance
is working on a reply...