Skip to content

Commit 8fbb61e

Browse files
Update README.md
1 parent a7ece85 commit 8fbb61e

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

README.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -370,6 +370,70 @@ bc<body>=green
370370

371371
> Note: When a request is made with WebFormJS, a header with the name `Post-Back` and the value `true` is also sent to the server. Therefore, it is easy to determine the response approach on the server.
372372
373+
## Multiple-Responses
374+
375+
Multiple-Responses is a useful feature in WebFormsJS that allows us to send multiple related responses in a single server response. The multi-response feature is a functionality similar to a JavaScript file that contains multiple offline functions (things that are not requested from the server).
376+
377+
In multiple-responses, action controls are separated by a `#` character. To execute the response, we need to add the `#` character and the index to the end of the path.
378+
379+
Example:
380+
381+
Response
382+
```
383+
[web-forms]
384+
bcTextBox1=green
385+
vi*h2:nth-of-type(2)=0
386+
#
387+
ta{my-textbox}1=right
388+
Eg{my-list}=onmouseenter|#
389+
fs<li>1=24px
390+
#
391+
ac(gender)2=my-css-class
392+
sv(email)=myemail@gmail.com
393+
#=MyIndex
394+
as[h2:nth-of-type(2)=margin:10px 20px
395+
bc<form>|<p>=violet
396+
tc<form>|<p>=yellow
397+
```
398+
399+
**Path and result**
400+
401+
Requesting `/my-view.aspx` or `/my-view.aspx#0`
402+
403+
The following action controls are performed:
404+
```
405+
bcTextBox1=green
406+
vi*h2:nth-of-type(2)=0
407+
```
408+
409+
Requesting `/my-view.aspx#1`
410+
411+
The following action controls are performed:
412+
```
413+
ta{my-textbox}1=right
414+
Eg{my-list}=onmouseenter|#
415+
fs<li>1=24px
416+
```
417+
418+
Requesting `/my-view.aspx#2`
419+
420+
The following action controls are performed:
421+
```
422+
ac(gender)2=my-css-class
423+
sv(email)=myemail@gmail.com
424+
```
425+
426+
Requesting `/my-view.aspx#MyIndex` or `/my-view.aspx#3`
427+
428+
The following action controls are performed:
429+
```
430+
as[h2:nth-of-type(2)=margin:10px 20px
431+
bc<form>|<p>=violet
432+
tc<form>|<p>=yellow
433+
```
434+
435+
> Note: Multiple-Responses are mostly used for offline cases and it is recommended to enable HTML headers for long-term client-side caching for multiple responses.
436+
373437
## PostBack and GetBack and TagBack method
374438

375439
`PostBack` and `GetBack` are two methods in WebFormsJS.

0 commit comments

Comments
 (0)