リクエストを使用して、ネストされたページでフォーム コントロールの値 (テスト) を取得する必要があります。
私のHTMLファイル
<asp:Content ID="Content1" ContentPlaceHolderID="CPHText" runat="server">
<asp:HiddenField ID="test" runat="server" />
</asp:Content>
コードビハインド
Public Sub RegisterNew(id As Guid) Implements testInterface
test.Value = id.ToString()
End Sub
Public ReadOnly Property IsInitProp As Boolean Implements testInterface
Get
Return Not Request("test") = String.Empty
End Get
End Property
を使用しRegisterNew()
て、テストフィールドに値を割り当てます。IsInitProp
プロパティで値を取得しようとすると、値を割り当てた後、 と表示されますNothing
。
しかし、以下のように通常のページ (ネストされたページではない) を使用すると、これは正しく機能します。
<form id="form1" runat="server">
<asp:HiddenField ID="test" runat="server" />
</form>
ネストされたページでこの隠しフィールド値を取得するにはどうすればよいですか?