form1.AcceptButton = accessButton;
,我把:
using System.Windows.Forms;
但它不找到它。它說System.Web.UI.HtmlControl.HtmlForm
沒有這個定義。嗯?
form1.AcceptButton = accessButton;
,我把:
using System.Windows.Forms;
但它不找到它。它說System.Web.UI.HtmlControl.HtmlForm
沒有這個定義。嗯?
把控制在面板和設置DefaultButton
:
<asp:Panel DefaultButton="accessButton" runat="server">
<asp:TextBox id="myname" runat="server" />
<asp:Button id="accessButton" Text="Submit" runat="server" />
</asp:Panel>
System.Windows.Forms和System.Web.UI是兩個完全不同的系統。 Windows窗體用於創建桌面應用程序,System.Web.UI用於創建ASP.NET頁面。您不能在ASP.NET中使用WinForms。
請參閱ASP.NET上的here。
使用Page.Form.DefaultButton
來代替。
System.Windows.Forms和System.Web.UI.HtmlControl.HtmlForm是兩個非常不同的東西。 Windows Forms用於創建桌面應用程序,System.Web.UI用於創建ASP.NET解決方案。您想做什麼? – 2013-02-20 14:59:00
網站方面:) ASP.NET,我在一個MasterPage ... – markzzz 2013-02-20 15:00:40