| |

VerySource

 Forgot password?
 Register
Search
Author: 天风鲁伊

The problem of passing the value of a column in the DataGrid through Session when clicking

[Copy link]

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 19:30:01
| Show all posts
Thank you upstairs, let me give it a try
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 19:45:01
| Show all posts
There are many command events, ItemCommand, EditCommand, etc., which event should be placed in?
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 20:00:01
| Show all posts
When binding data, it is executed in a loop. Assigning a value to session["LoginName"] in the loop is certainly not what you need. Prevent the command event and assign the loginName value of the current line to the session after clicking.

--------------

No, the command event does not respond to click events
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-17 20:15:01
| Show all posts
OnItemCommand
achievable
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 20:30:01
| Show all posts
Suddenly understand, give it a try
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-17 20:45:01
| Show all posts
Oh sorry, indeed, I used an imagebutton to click directly, it does not trigger OnItemCommand
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 21:00:01
| Show all posts
No way, add a button bar, so it becomes very easy

Thank you all for your kind help! I hope someone can solve this problem in the future
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-17 21:15:01
| Show all posts
onclick is a client-side event, it does not go to the server-side, it does not return, so no background event is triggered
Reply

Use magic Report

0

Threads

15

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-10-17 21:30:01
| Show all posts
But if you are not afraid of trouble, call the script and then call the background Ajax method, maybe you can assign a value to the session
I don’t know how to assign a value to the session in the foreground.
Reply

Use magic Report

3

Threads

26

Posts

13.00

Credits

Newbie

Rank: 1

Credits
13.00

 China

 Author| Post time: 2020-10-17 21:45:01
| Show all posts
Oh,terrysx, thank you
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list