So I am new to Umbraco and I am trying to determine what the best practices or technique is to achieve something. Let me give you the scenario.
I have one page that is an application page. Once a user submits and application an api request is made to submit the app and that returns with a code. The return code implies what message we give to the user.
What I would like to do is redirect the user to that "Thank You" page with the code in the query string. The Thank You page for all the codes has a lot of similar content. However there is custom message also required for each code. What is the best way to render the custom content based on the querystring value for code? Partial Views?
if you need specific sentences for each return code that you use then it could be an option to add them as dictionary entries in Umbraco. The key would be the response code and then you can just grab the sentence by using the return code as the key in @Umbraco.GetDictionaryValue(returnCode)
Best Practices / Pattern
So I am new to Umbraco and I am trying to determine what the best practices or technique is to achieve something. Let me give you the scenario.
I have one page that is an application page. Once a user submits and application an api request is made to submit the app and that returns with a code. The return code implies what message we give to the user.
What I would like to do is redirect the user to that "Thank You" page with the code in the query string. The Thank You page for all the codes has a lot of similar content. However there is custom message also required for each code. What is the best way to render the custom content based on the querystring value for code? Partial Views?
Thoughts? Any guidance / ideas is appreciated.
Hi Brian
I would start from pitfalls/antipatterns, look please here really cool doc- https://our.umbraco.org/documentation/reference/Common-Pitfalls/
I prefer to write logic like you need in Controllers, do not write a lot of logic in partials. RenderMvcController looks like exactly what you need, it calls before view and you can do all logic here, read more - https://our.umbraco.org/documentation/reference/routing/custom-controllers
Thanks,
Alex
Hi Brian,
if you need specific sentences for each return code that you use then it could be an option to add them as dictionary entries in Umbraco. The key would be the response code and then you can just grab the sentence by using the return code as the key in
@Umbraco.GetDictionaryValue(returnCode)
Regards David
is working on a reply...