You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+64Lines changed: 64 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -370,6 +370,70 @@ bc<body>=green
370
370
371
371
> 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.
372
372
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
+
373
437
## PostBack and GetBack and TagBack method
374
438
375
439
`PostBack` and `GetBack` are two methods in WebFormsJS.
0 commit comments