Sitefinity Mvc page redirection issue.

Posted by Community Admin on 04-Aug-2018 07:36

Sitefinity Mvc page redirection issue.

All Replies

Posted by Community Admin on 05-Jul-2016 00:00
Hi All,

I have developed a page using custom Mvc Sitefinity widgets say Corticon Form Widget and Simple Response Widget.

Here, I fill the Corticon form date and click submit button, then the response will be placed on the same page.
Again I fill the date and click submit button then I was getting an error message as “The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.”


Can someone please help me how to resolve this issue?

Below is the recorded video on above issue for better understand.

drive.google.com/open

Please let me know if need more information.

Thanks,
Balu
Posted by Community Admin on 05-Jul-2016 00:00

Hi Balu.

As i can understand from video, Problem is that first time you submitting the form to /insurance/skydive and second time you trying to submit form to /insurance/skydive/cortionindex url

 

Posted by Community Admin on 05-Jul-2016 00:00
Hi Victor,

You are correct.

I was calling Simple Corticon Response Action Result from form submit action result so the URL was changing to /insurance/skydive/cortionindex.
How can I submit form with different inputs?

Thanks,
Balu
Posted by Community Admin on 05-Jul-2016 00:00

You have two options:

1) Avoid changing url. Don't redirect to cortionindex, just return necessary view

2) Specify correct action path into your <form> tag

Posted by Community Admin on 11-Jul-2016 00:00
Hi Victor,

Thank you for your inputs. However, I couldn’t get the solution.

In my response widget, I was returning only view but the same issue happening.

If possible, can you please share code snippet on this issue.

Thanks,
Balu
Posted by Community Admin on 23-Jul-2016 00:00
Hi Victor,

Can you please provide some more info on this issue?

Thanks,
Balu
Posted by Community Admin on 25-Jul-2016 00:00

Hi Balu. Sorry for late response.

Inside your controller instead redirecting return View.

Please, replace

return RedirectToAction("CorticonIndex",controllerName)

to

return CorticonIndex()

 

Posted by Community Admin on 25-Jul-2016 00:00
Hi Victor,

I am happy that you have commented.
As per my understanding, you are returning the view. If I use return CorticonIndex (), it gives an error message "CorticonIndex ()" doesn’t exist.

FYI.

I was redirecting/calling  CorticonIndex() of "CorticonResponse" controller from “CorticonForm” Controller with below code snippet.
return RedirectToAction ("CorticonIndex”, CorticonResponse")
And Inside CorticonResponseController, returning CorticonResponse view with CortsiocnResponseModel as parameter.

Thanks,
Balu
Posted by Community Admin on 28-Jul-2016 00:00
Hello, I suppose the problem is not how the result is returned but how the submit link is generated. Could you please share the code you use for the submit button? Which widget is handling and "ConrticonIndex" action? Regards, Nikola Zagorchev Telerik by Progress
Posted by Community Admin on 29-Jul-2016 00:00
Hi Nikola,

Thank you for your comment. The issue got resolved.

I have removed Index () method in FormController and modified CorticonIndex action name as Index () and decorated with HttpPost.Now, when I submit form, controller goes to Action () of CorticonResponse controller.

Is it possible to get FormController properties inside Action () method of ResponseController?

Thanks,
Balu


Posted by Community Admin on 29-Jul-2016 00:00
Hello, The control properties are saved in the database and loaded with the control. The different controls are not supposed to know about each others properties. If you need to pass some of the property values, I recommend doing this through the Model and the form to submit to the other Controller. Regards, Nikola Zagorchev Telerik by Progress
This thread is closed