Super Contributor.
Super Contributor.
550 views

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.

0 Likes
1 Reply
Highlighted
Micro Focus Expert
Micro Focus Expert

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

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.