PreviousPage.Master.FindControl

I have a Master Page and it has a TextBox where User Name is informed, I would like to pass this information to the other system page?

To call the pages I'm using.

                             <Asp: MenuItem Text = "Home" Selectable = "false">
                                 <Asp: MenuItem NavigateUrl = "~ / Default.aspx" Text = "Home" />
                                 <Asp: MenuItem NavigateUrl = "~ / Login.aspx" Text = "Login" />
                             </ Asp: MenuItem>

Must pass the txUsuario information to other pages?

                     <Asp: TextBox ID = "txUsuario" runat = "server" CssClass = "textbox"> </ asp: TextBox>

I found in C # PreviousPage.Master.FindControl but I can not find a translation in Cobol.

Translated by Google

Eu tenho um Master Page e nela tem um TextBox onde é informado o Nome do Usuário, gostaria de passar esta informação para as outras página do sistema?

Para chamar as páginas estou usando.

                            <asp:MenuItem Text="Inicio" Selectable="false">
                                <asp:MenuItem NavigateUrl="~/Default.aspx" Text="Inicio" />
                                <asp:MenuItem NavigateUrl="~/Login.aspx" Text="Login" />
                            </asp:MenuItem>

Preciso passar a informação do txUsuario para outra páginas?

                    <asp:TextBox ID="txUsuario" runat="server" CssClass="textbox"></asp:TextBox>

Encontrei em C# PreviousPage.Master.FindControl mas não consigo fazer a tradução para Cobol.

  • I don't believe that PreviousPage will work when you are transferring control using NavigateURL as the PreviousPage property will = null. In this case you might want to set a session variable in the first page and then access it from the new page.

    I can get the PreviousPage.Master.FindControl to work properly when the new page is displayed by using Server::Transfer instead of NavigateURL.

    In the new page's Page_Load event I use the following:

        If not IsPostBack

            declare myContent as type ContentPlaceHolder = self::PreviousPage::Master::FindControl("MainContent") as type ContentPlaceHolder

            declare myTexbox as type TextBox = myContent::FindControl("TextBox1") as type TextBox

            set TextBox2::Text to myTexbox::Text

        end-if