I have a partial control formy.ascx that I am using on a lot of pages that contains a form.
When I click submit on the partial control, following function handles the form submission.
[ActionName("FormyTemp"), AcceptVerbs(HttpVerbs.Post)]
public ActionResult FormyTemp(FormCollection result)
Now, I need to know what page i.e. action I was on when this form was submitted.
I tried passing (string)ViewContext.RouteData.Values["action"] as one of the form parameters, but it’s telling Formy as the action when that is just a partial control. How should I go about doing this? I can’t just look at the URL because some of my URL’s are like domain.com/actionName and some of them are like domain.com/controllerName/actionName.
Also, please don’t tell me to use RenderPartial…I need to use RenderAction
From my understanding, you need to know the action of the Parent form, not the individual RenderAction that rendered the partial. In that case you can use the following: