none
I can not get a reference to second view elements RRS feed

  • Frage

  • I can not access in the second view elements reference . why it could be

    <body onload="show()" >
        <form id="form1" runat="server">
        <div>
            <asp:MultiView ID="MultiView1" runat="server">
                <asp:View ID="View1" runat="server">

                    <table class="auto-style1">
                        <tr>
                            <td class="baslik">Adı </td>
                            <td>
                                <asp:TextBox ID="a1" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style2">Soyadı</td>
                            <td class="auto-style3" id="a2">
                                <asp:TextBox ID="a2" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style6">Memleket</td>
                            <td class="auto-style7">
                                <asp:TextBox ID="a3" runat="server" ClientIDMode="Static" TextMode="MultiLine" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>

                </asp:View>
                <asp:View ID="View2" runat="server">
                    <table class="auto-style1">
                        <tr>
                            <td class="baslik">Meslek</td>
                            <td>
                                <asp:TextBox ID="b1" runat="server" ClientIDMode="Static" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="auto-style4">Mezuniyet</td>
                            <td class="auto-style5">
                                <asp:TextBox ID="b2" runat="server" ClientIDMode="Static" OnTextChanged="TextBox5_TextChanged" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="baslik">Branş</td>
                            <td>
                                <asp:TextBox ID="b3" runat="server" ClientIDMode="Static" TextMode="MultiLine" Width="300px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </asp:View>
            </asp:MultiView>
        </div>
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="1. Aşama" />
            <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="2. Aşama" />
        </form>
    </body>

    Javascript code

       

    function show() {
        var txt = new Array();
        var alan = ['a1','a2','a3','b1','b2','b3'];

        for (var i = 0; i < alan.length; i++) { 
            txt[i]=document.getElementById(alan[i]);
            txt[i].addEventListener("keyup", wsss, true);
        }
        alert(txt.length);
    }
    function wsss(e){

        alert("Mesaj"); // this method not work at the second view elements(textBox)
    }

    why could it be
    Freitag, 5. Mai 2017 07:35