Hello,
I have a screen where at top it has a fiscal period dropdown and when changed it should redirect me to same screen but for the year selected.
Issue : I have upload functionality on that view. upload functionality calls the post method say "actionmethod1" and the screen comes from "actionmethod2". so when i do upload the url is /actionmethod1 and when i select dropdown it will take to last action method invoked i.e actionmethod1 and saw it throws error as resource not found.
code being used for redirecting in jquery :
@HttpContext.Current.Request.RequestContext.RouteData.
it calls the post action method of upload and throws an error.
we are using kendo upload functionality which uses
form method="post" action='@Url.Action("Upload", "controllername")'>
so how to navigate the same screen using actionname of the screen
What I have tried:
I am trying to use UrlReferrer method to get parent or earlier actionmethod and controller name so that it takes me to same view.
issue is
1) i am unable to check if exists on request.urlReferrer. It is failing always
if(Request.UrlReferrer !== null)
{
var path = @HttpContext.Current.Request.UrlReferrer.LocalPath.ToString();
}
But for some reason even for null UrlReferrer it is satifying if condition and getting null exception error.
2. Is it good to use urlReferrer as it is client side. Are there any other suggestions providing how to navigate through..
Thank you