Code Asp Core with React: Save in API with Authorize, Validate Antiforgery
12.03.2021 6792
Example code for
Asp Core and React
Asp Core Server Code
The code contains
the Asp Core code for the Startup cs and the controller It is important to me
that the code for the Authorization and ValitdateAntiforgery is transferred to
the API
React Code
The React Code
shows how the data is collected from the server via an API and stored again
React IF Else in Render()
02.03.2021 945
How to create
conditional rendering of HTML elements in React with IF ELSE ?
Task:
The following
HTML Link Button should only be displayed in React if a condition is met
✅ Solved: TS3657: (JS) JSX expressions must have one parent element.ts (2657)
02.03.2021 1324
TS3657:
(JS) JSX expressions must have one parent element ts (2657)
Error message in
React
TS3657: (JS) JSX expressions must have one parent
element ts (2657)
Faulty code:
Using Editable of React Input Fields
01.03.2021 2382
If you want to
use an HTML editable input field in React, you only have to insert the Attibut
contentEditable into the HTML tag
However, react
automatically converts HTML elements into the DOM document when you insert text
that represents HTML
This is a central
element in HTML itself, and doesn't even come from React
What does that
mean?
1
Render React with When IF is True
26.02.2021 843
React: Render with if HTML
For status-related displays of HTML elements, you can either define an if (
range ) directly in the render() block or
{
React: Set default page with Redirect
26.02.2021 990
With Redirect
you can redirect pages to a new address
This also
allows you to set the default home page of a web page
Code in the
React app launch file app js
App js
React TypeError: Cannot read property send_Data_to_Api of undefined
25.02.2021 1507
React TypeError:
Cannot read property 'send_Data_to_Api' of
Error message:
React: Link mit onClick
25.02.2021 914
React: Link with onClick
Example code with onClick event on a React Link or HTML Link
Variant 1: With HTML a href
Make React Input Editable
25.02.2021 5167
If you use
ormular input fields in Reactand define them with value=this state variable,
then the inputs are no longer saveable
There are 2
ways to make the React Input fields editable:
1)
Use defaultValue instead of value
2)
React TextField variant settings
25.02.2021 1159
Material UI Form Text input with variant= "outlined"
|