score:0
in the asp.net core + react templates by microsoft, the layout is not handled in the back-end with asp but in the front-end with react. in the clientapp/src/components folder, you will find a layout.js file for this usage.
however, nothing stops you to create a partial view _layout.cs and use razor pages / mvc as a react overlay. this way, every page should be handled with an asp controller. inside them you would add an empty html tag to place your react app if you need it.
in the clientapp/src/index.js file, you will find the following line:
const rootelement = document.getelementbyid('root');
you need to replace the element id by the one where you want to render your react application in the dom.
but typically, when using asp with react, the front-end is left entierly to react. asp is only useful for api controllers handling ajax requests coming from react, and interacting with a database using entity framework.
Source: stackoverflow.com
Related Query
- Connecting a component with OwnProps using react redux and typescript in the .NET Core 2.0 reactredux template project
- Updating react grid layout using redux onLayoutChange
- React Redux create container with render function for template
- Publishing error in Visual Studio 2019 with React with Redux template
- VS2017: Using JSX components from react theme in ASP.NET Core React Redux web application template
- Using Redux-Saga in New Redux template react app
- How to snap to a certain section of the webpage using a react redux template
- ASP.NET React Redux Template + _Layout.cshtml
- What is the best way to access redux store outside a react component?
- Difference between component and container in react redux
- React + Redux - What's the best way to handle CRUD in a form component?
- Get version number from package.json in React Redux (create-react-app)
- React / Redux and Multilingual (Internationalization) Apps - Architecture
- How to show a loading indicator in React Redux app while fetching the data?
- When should I add Redux to a React app?
- React router redirect after action redux
- Where do I fetch initial data from server in a React Redux app?
- Firing Redux actions in response to route transitions in React Router
- React + Redux - Input onChange is very slow when typing in when the input have a value from the state
- When do I choose React state Vs Redux Store
- My Redux state has changed, why doesn't React trigger a re-render?
- having multiple instance of same reusable redux react components on the same page/route
- Redux vs plain React
- Accessing Redux Store from routes set up via React Router
- What is the core difference of redux & reflux in using react based application?
- Nested components testing with Enzyme inside of React & Redux
- Prevent react component from rendering twice when using redux with componentWillMount
- Expected onClick listener to be a function, instead got type object - react redux
- React get state from Redux store within useEffect
- React - Redux App: "Invalid attempt to spread non-iterable instance" Issue
More Query from same tag
- filter with react state not filtering values
- how to use props to change className ? (reactjs/css)
- componentDidMount keeps calling repeatedly after changing props
- React js quill image upload
- How to iterate through JSON data and dynamically create and populate components in React?
- Error while creating validations for react-hook-form
- Dynamic className in map not changing after update
- Support for the experimental syntax 'jsx' isn't currently enabled when using webpack and babel
- How to filter what will be submitted in a Form
- Using modular CSS with Bootstrap 4 and React
- http proxy middleware is not created proxies in my react app
- How to add dynamic routes in express server?
- why the webpack build react app home page stay blank
- HRMS Project - Process of Adding CV
- All requests through one function, which adds accessToken itself
- Deploy create-react-app with react-router to Godaddy routing issue
- How can i get a client side cookie with next.js?
- Dynamically render components from a Immutable.js map
- Focus the Input automaticly in a react way every time I refresh the page
- Material-ui paper doesn't render on screen
- React: Define constants?
- Acknowledge RabbitMQ message after socket IO event received from React browser
- Webpack 4 Proxy (How to set up proxy url in webpack 4)
- Omit specific prop from an emotion styled component?
- Not able to set the relative position of Divs
- Child re-rendering because of function?
- How to deal with initial null values react.js
- How to generically create table cell and rows with an array of objects
- props.deleteComments not a function
- react dc.js import not working