首页 > 解决方案 > 在 ASP .NET 中访问多页项

问题描述

我在 ASP .NET 中有一个使用 MultiPage 的页面,就像这样

多页图像

问题是我需要访问在第二个选项卡中找到的元素,但是当我进行搜索时,它返回 null。

它不允许我访问当前未选择的选项卡中的项目。例如,在“常规”中,如果我在“安全”中搜索元素,则搜索返回 null。

这是 MultiPage 代码(我把它放在更少的字段中,因为它们很多而且非常广泛)。

<table cellspacing="0" cellpadding="10" width="100%" border="0">
    <tbody>
        <tr>
            <td>
                <div id="clientDiv">
                    <mytab:TabStrip ID="tsHoriz" Style="FONT-WEIGHT: bold; FONT-SIZE: small" runat="server"
                        TargetID="mpHoriz">
                        <!-- TabStrip here -->
                    </mytab:TabStrip>

                    <mytab:MultiPage ID="mpHoriz"
                        Style="BORDER-TOP: 3px solid; BORDER-LEFT: 1px solid; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; BORDER-RIGHT: 1px solid; BORDER-BOTTOM: 1px solid;"
                        class="borde" runat="server">
                        <mytab:PageView>
                            <!--Elementos Pestaña 1 General-->
                            <table width="100%">
                                <tr>
                                    <td align="center">
                                        <table>
                                            <tr>
                                                <td align="right">
                                                    <asp:Label ID="lbl_status" runat="server" CssClass="text_S10">
                                                        Status:</asp:Label>
                                                </td>
                                                <td colspan="2" align="left">
                                                    <asp:DropDownList ID="ddl_status" runat="server" CssClass="text_S11"
                                                        Style="width: 150px;">
                                                        <asp:ListItem Value="-1">--- Seleccione ---</asp:ListItem>
                                                        <asp:ListItem Value="A">Active</asp:ListItem>
                                                        <asp:ListItem Value="C">Cancelado</asp:ListItem>
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </mytab:PageView>

                        <mytab:PageView>
                            <!--Elementos Pestaña 2 SEGURIDAD-->
                            <table cellpadding="0" cellspacing="0" align="center" width="100%" bgcolor="white"
                                border="0" bordercolor="#cc0000" class="text_S10">
                                <tr>
                                    <td valign="top" align="center">
                                        <table class="text_S10" border="0">
                                            <tr>
                                                <table cellpadding="0" cellspacing="2" align="center" width="100%"
                                                    bgcolor="white" border="0" bordercolor="#cc0000"
                                                    cssclass="text_S11">
                                                    <tr id="__tr_accounts">
                                                        <table width="100%" id="__tbl_accounts"></table>
                                                    </tr>
                                                </table>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                            </table>
                        </mytab:PageView>
                        <mytab:PageView>
                            <!--Elementos Pestaña 4 CONTACT-->
                        </mytab:PageView>

                        <mytab:PageView>
                            <!--Elementos Pestaña 5 ESPECIALES-->
                        </mytab:PageView>
                    </mytab:MultiPage>
                </div>
            </td>
        </tr>
    </tbody>
</table>

位于“常规”中的以下返回 null

document.getElementById('__tbl_accounts');

提前致谢

标签: asp.netasp.net-mvc

解决方案


推荐阅读