| |

VerySource

 Forgot password?
 Register
Search
View: 677|Reply: 4

Why can't my parameters be maintained?

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-20 14:30:01
| Show all posts |Read mode
xxx.aspx.cs
public class xxx: ...
{
private string Fdw_number;

private void page_load (.............)
{
...
Fdw_number = this.request ["dwid"]
...
}

private void btnOK_ServerClick (object sender, System.Web.UI.ImageClickEventArgs e)
{
...
TextBox1.Text = Fdw_number;
...
Ranch
}

I don't know why the value of Fdw_number cannot always be maintained?
Reply

Use magic Report

0

Threads

7

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-4-27 22:00:01
| Show all posts
Because each time the server sends an HTML document to the client, the life cycle of a page is completed, and the life cycle of private variables is also completed. Use the Session variable to save it.
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-4-28 16:30:01
| Show all posts
Thank you guys for the explanation, I understand 1 big problem
Reply

Use magic Report

0

Threads

43

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-4-29 01:15:02
| Show all posts
Can also be saved with viewstate
Reply

Use magic Report

0

Threads

17

Posts

11.00

Credits

Newbie

Rank: 1

Credits
11.00

 China

Post time: 2020-4-29 13:45:01
| Show all posts
Viewstate on the same page is better!
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