Different views on one page

mlt 1 Reputation point
2021-06-28T09:46:47.347+00:00

I have a site where the user enters different information to buy each product . How do I manage that the details view page is different to be one page and the displayed information is different?

Show different items in the same view. For example, when the user clicks on product one, how do I display the items related to product one, and when the user clicks on the second product, the items specific to the second product?

like this site

https://shop.mrbeam.co.uk/

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,816 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 59,986 Reputation points
    2021-06-28T13:24:26.63+00:00

    If you are just changing the data shown then the correct approach is to put that data retrieval behind an API and use your client side framework (CSF) of choice to query the API to retrieve the related data. Once the data is returned to the client again use your CSF of choice to update the UI to show the data. There is no need for any custom views. If you aren't using a CSF yet then you need to otherwise this is going to be a really poorly performing UI.

    Just for demo, if you aren't using a CSF, then the equivalent would be to post back to the server, have the server retrieve all the data for the view again, including any custom data, and then return the updated view to the client for rendering.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.