■95216 / ) |
FindControlが取得できない |
□投稿者/ asp初心者 (4回)-(2020/07/02(Thu) 11:54:49)
|
分類:[.NET 全般]
2020/07/02(Thu) 12:58:46 編集(投稿者)
ASP.NET WebForm
Dim text1 As TextBox = Page.PreviousPage.FindControl("TextBox1") でFindControlを取得しようとしたところ、取得できず下記内容の記事を参考に https://zukucode.com/2017/09/aspnet-master-findcontrol.html
マスターページを使っていたので Dim text1 As TextBox = Me.Master.FindControl("MainContent").FindControl("TextBox1") と修正したのですが、実行してみるとNathingでかえってきます。 runat="server"はちゃんと記述してあるのですが・・・原因不明です。
Dim text1 As TextBox = Me.Master.FindControl("MainContent").Page.PreviousPage.FindControl("TextBox1") このようにしてもダメでした。
解決策がありましたら、宜しくお願い致します。
|
|