「静的」変数はクラスのすべてのインスタンスで共有されるため、Web サイトの開いているすべてのページで共有されるのではないかと考えていました。
例:次のものがあるとしましょう:
private static string SelectedName = "";
protected void SendButton_OnClick(object sender, EventArgs e)
{
SelectedName = NameTextBox.Text;
DisplayLabel.Text = SelectedName;
}
// ... other functions that depend on SelectedName's value
2 人が私のページを開いた場合.. ユーザー #1 は、名前のテキスト ボックスに「Bob」と入力し、送信を押します。別の場所にいるユーザー #2 がページを開きます。DisplayLabel のテキストとして "Bob" が表示されますか?