0
網頁我有文本框和按鈕。按下後不需要按鈕上onClick事件輸入
我添加了onClick按鈕。
問題是,如果我點擊在文本框中輸入它也調用onClick事件按鈕。我明白爲什麼。
我的代碼是在這裏:
文本框是在視圖:
<asp:View ID="BlView" runat="server">
<p class="tabHead"> BLACK LIGHT LABEL DATA </p>
<table class="tab">
<tr>
<td>
<asp:Label ID="Label1" runat="server" class="label" Text="BARCODE" />
</td>
<td>
<asp:TextBox ID="bl_tb_barcode" runat="server" BorderWidth="1px"
class="textBox" Width="700"/>
</td>
</tr>
</table>
</asp:View>
按鈕的代碼是在這裏:
<div class="divPrinter">
<asp:DropDownList runat="server" class="dropDownList" Width="250" Height="35"
ID="cbPrinters" style="margin-top:80px"/>
<asp:Button ID="btnPrint" runat="server" class="btnPrint" style="margin-top:80px"
Width="120" Height="35" Text="Print" onclick="BtnPrintClick" />
</div>