使用AutoPostback = True从Textbox_TextChanged调用显示模态。 (帮助,模态不显示)

时间:2017-12-10 15:28:55

标签: javascript c# asp.net modal-dialog bootstrap-modal

我有一个模式,我想在文本框的textchanged事件上显示。我知道我需要用函数调用模态,因为文本框没有像数据切换那样可以绑定到按钮。任何人都可以教我如何从textbox_textchanged中调用模态?

这是我文本框的属性。

<asp:TextBox class="input-material" ID="barcodeInput" runat="server" Placeholder="Scan Your Matric Card" Text="" OnTextChanged="TextBox_TextChanged" AutoPostBack="True"></asp:TextBox>

我的模态设计:

<div id="mymodal" class="modal fade" role="dialog" runat="server">
    <div class="modal-header">
        <strong><asp:Label ID="welcomeerror" runat="server" Text=""></asp:Label></strong>
        <button type="button" class="close" data-dismiss="modal">&times;</button>
    </div>

    <div class="modal-body">
        <asp:Image ID="avatar" runat="server" class ="img-fluid rounded-circle" ImageUrl="~/GUIs/img/imgDefault.png"/></div>

        <div>
            <p>Student Name  :</p>
        </div> 
        <asp:Label ID="studentName" runat="server" Text="Student Name" class="label-material"></asp:Label>
        <div>
            <p>Matric Number  :</p>
        </div>
        <asp:Label ID="matricNo" runat="server" Text="Matric No" class="label-material"></asp:Label>
        <div>
            <p>Attendance Date/Time  :</p>
        </div>
        <asp:Label ID="attendanceDateTime" runat="server" Text="Time Attended" class="label-material"></asp:Label>
    </div>            
    <div class="modal-footer">
        <strong><asp:Label ID="Label1" runat="server" Text="Thank You For Attending This Activity"></asp:Label></strong>
    </div>
</div> 

0 个答案:

没有答案