I have added a table to contactForm page and used @Html.ActionLink("Something", "Edit", new { Id = 1 }) which is routing to the url: localhost:50151/umbraco/Surface/ContactSurface/Edit/1 instead of locahost:50151/Contact/Edit/1 or locahost:50151/ContactSurface/Edit/1 is there any way while using umbraco to use custom route and set the Url to: locahost:50151/Contact/Edit/1 or locahost:50151/ContactSurface/Edit/1
Code snippet:
public class ContactSurfaceController : SurfaceController
{ public ActionResult Edit (int Id)
{
ContactViewModel model = new ContactViewModel();
return View(model);
}
Problem/Question: If I leave my url like this ( localhost:50151/umbraco/Surface/ContactSurface/Edit/1 ) I am getting error : Cannot bind source type CleanBlog.Core.ViewModels.ContactViewModel to model type Umbraco.Core.Models.PublishedContent.IPublishedContent. as i need model to be passed to the view
Hope my issue is clear and please do let me know if you need any further information
Url issue and model binding issue
Hi Guys
I have added a table to contactForm page and used @Html.ActionLink("Something", "Edit", new { Id = 1 }) which is routing to the url: localhost:50151/umbraco/Surface/ContactSurface/Edit/1 instead of locahost:50151/Contact/Edit/1 or locahost:50151/ContactSurface/Edit/1 is there any way while using umbraco to use custom route and set the Url to: locahost:50151/Contact/Edit/1 or locahost:50151/ContactSurface/Edit/1 Code snippet:
}
Edit.Cshtml page looks like
Problem/Question: If I leave my url like this ( localhost:50151/umbraco/Surface/ContactSurface/Edit/1 ) I am getting error : Cannot bind source type CleanBlog.Core.ViewModels.ContactViewModel to model type Umbraco.Core.Models.PublishedContent.IPublishedContent. as i need model to be passed to the view
Hope my issue is clear and please do let me know if you need any further information
Thanks in advance
I have used TempData["something"] and assigned model to this, which is passed on to partial view in return
Helped me in solving my problem, but not sure if this is correct approach.
is working on a reply...