Passing back data from the controller to view component view

Ei Dar Li Ko Ko asked on December 9, 2022 07:10

I have a login widget where it will link over to the Account Controller and Controller will pass back the data to the login widget view, however, when it pass back the data, the controller go to its own route, instead of passing the data to the page where the widget is.

Correct Answer

Trevor Fayas answered on December 12, 2022 20:22

As Jeroen mentioned, the Baseline has a couple tools that help preserve and re-hydrate the ViewState and other aspects. It uses the concept of "Post-Redirect-Get" where you Post to the controller, it saves the state then redirects back to the original page, which gets the state and restores it.

See article here in the wiki

0 votesVote for this answer Unmark Correct answer

Recent Answers


Jeroen Fürst answered on December 12, 2022 08:01

Hi,

Have a look at the example implementation in Kentico13CoreBaseline. It contains several authentication examples that might be useful for you.

Cheers, Jeroen

1 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.