TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Rahul Patel
1.6k
105
10.9k
child actions are not allowed to perform redirect actions.
Aug 18 2018 3:09 PM
child actions are not allowed to perform redirect actions. partial view
I'm trying to use Create view with the index view to show the created item in the same page. For that I'm using _CreateCategory as the partial view and I added following to the index view.
When I am postback the form then my child action uses the http post method insted of http get method.
// In view
@Html.Action("Create", "Products")
My controller's get and post methods as follows for the Create
[HttpGet]
public ActionResult Create()
{
Products pro = new Products();
return PartialView("Create", pro);
}
[HttpPost]
public ActionResult Create(Products pro)
{
if (ModelState.IsValid)
{
db.Categories.Add(category);
db.SaveChanges();
return RedirectToAction( "Index");
}
return RedirectToAction("Index");
}
My index method as follows
public ActionResult Index()
{
//get data from db
return View(Model);
}
[HttpPost]
public ActionResult Index(string a, string B)
{
//get data from db
return View(Model);
}
Reply
Answers (
4
)
C# Data Grid Export to Excel File Not working
Could not find file 'openFileDialog1