Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 16, 2012 11:22 AM by pchindhade
Apr 16, 2012 11:02 AM|LINK
I am using MVC2. and i am new to it.
I have an application that creates the user with registration. i have one controller with all the textboxs and submit button.
Now i want to redirect to specific class that can add user into database.
after adding user into database user should be redirected to registration page with message of user added.
i want to know how to redirect from page to any class in asp.net mvc2.
Apr 16, 2012 11:16 AM|LINK
Use the RedirectToAction ActionResult to redirect the user to another controller/action:
public ActionResult Index()
//Add user to database.....
return RedirectToAction("Action", "Controller");
Apr 16, 2012 11:22 AM|LINK
ya got it.....actually i m trying that and got it.
anyways thanks for your reply.