I have an Employee folder under Views, with a bunch of Views & Partial views - for edit/create/details and templates and its starting to get kinda messy...id like to create subfolders and move the related files there..
View
/Employee
Index.aspx
Edit.aspx
EditPartial1.ascx
EditPartial2.ascx
Details.aspx
DetailsPartial1.ascx
DetailsPartial2.ascx
Id like for it to look like
View
/Employee
Index.aspx
/Edit
Edit.aspx
EditPartial1.ascx
EditPartial2.ascx
/Details
Details.aspx
DetailsPartial1.ascx
DetailsPartial2.ascx
What do i do in the controllers to redirect this properly
public ActionResult Edit(int id)
{
//Do stuff for edit
return View("Edit", employee);
}
}
to something like this?
public ActionResult Edit(int id)
{
//Do stuff for edit
return RedirectToRoute("Edit", employee);
}
}
Jerrolds
Member
95 Points
123 Posts
Cleaning up my views - moving aspx/templates to other folders?
May 19, 2010 04:21 PM|LINK
I have an Employee folder under Views, with a bunch of Views & Partial views - for edit/create/details and templates and its starting to get kinda messy...id like to create subfolders and move the related files there..
View
/Employee
Index.aspx
Edit.aspx
EditPartial1.ascx
EditPartial2.ascx
Details.aspx
DetailsPartial1.ascx
DetailsPartial2.ascx
Id like for it to look like
View
/Employee
Index.aspx
/Edit
Edit.aspx
EditPartial1.ascx
EditPartial2.ascx
/Details
Details.aspx
DetailsPartial1.ascx
DetailsPartial2.ascx
What do i do in the controllers to redirect this properly
public ActionResult Edit(int id) { //Do stuff for edit return View("Edit", employee); } } to something like this? public ActionResult Edit(int id) { //Do stuff for edit return RedirectToRoute("Edit", employee); } }