简体   繁体   中英

Does not contain definition of button in asp.net application

I would like to use id in code behind in aspx.cs. Not sure how to use it.

<input name="SelectAllButton" type="button" id="SelectAllButton"  value="DeSelect All" class="EButton" title="DeSelect All" />

aspx.cs code

SelectAllButton.ID = "SelectAllButton";

But If use webbutton then it works but I do not want to use it.

<cc1:WebButton ID="SelectAllButton" runat="server"></cc1:WebButton>

For ASP Web Forms, you should use the ASP input types. <input /> is a client-side HTML input and won't be seen by the server.

I believe you will want to use asp:Button type.

Eg <asp:Button id="SelectAllButton" Text="DeSelect All" class="EButton" runat="server" />

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM