Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Page1.aspx含んでいます
Page1.aspx
Name: <asp:TextBox ID="txt1" runat="server" />
Page2.aspxによってそのコンテンツにアクセスしようとします
Page2.aspx
TextBox txt2 = (TextBox)PreviousPage.FindControl("txt1");
ただし、オブジェクト例外のインスタンスに設定されていないオブジェクト参照を取得することになります
新しいページに移動したら、最後のページはおそらくなくなっているので、セッションを介してデータを転送することをお勧めします。