我有3個不同的提交按鈕(登錄,搜索,插件)在同一頁,我想要的是找到最好的辦法當我按下它們時,讓這3個按鈕可以做不同的事情,或者在我即將按下時按下Enter鍵。 正如您從我的照片中看到的,當我按Log In
時,也會按下插入,因爲我的主頁中有一個global form
。
我試圖使用不同的形式,但我不能,因爲我需要他們有runat="server"
,這是不可能的一頁。
我用asp Texboxes:
<asp:TextBox class="text-input" ID="txtLoginEmail" runat="server"
Height="15px" Width="130px"></asp:TextBox>
和ASP按鈕:
<asp:Button class="submit google-button" ID="btnLogin" onclick="btnLogin_Click"
runat="server" Text="Log in" />
,除了我的搜索按鈕,這是LinkButton的:
<asp:LinkButton ID="searchLink" runat="server" onclick="searchLink_Click">Search</asp:LinkButton>
檢查其中哪些人進行了回傳。 (發件人參數)。除此之外,請看看Model View Presenter。這是使用webforms的一個好方法 –