简体   繁体   中英

Control 'windowMasterSearchBox' of type 'TextBox' must be placed inside a form tag with runat=server

Not sure where I'm going wrong in terms of not having a windowMasterSearchBox placed within a form tag with runat=server. I'm getting the following error: Control 'windowMasterSearchBox' of type 'TextBox' must be placed inside a form tag with runat=server. Any help would be appreciated. Thanks!

            <div class ="field">
                <a title="Search Students" id="windowMasterMagnifyingGlass"><img src="/images/icons/magnifyingBlack.png" alt="Search Students" border="0" /></a>
                    <asp:TextBox id="windowMasterSearchBox" runat="server" placeholder="Enter Student Name..."/>
                    <asp:Label id="windowMasterSearchBoxLabel" AssociatedControlId="windowMasterSearchBox" Text="Search: " runat="server"/>
            </div>

ASP.NET controls must be inside a form.

<form runat="server">

    <div class ="field">
        <a title="Search Students" id="windowMasterMagnifyingGlass"><img src="/images/icons/magnifyingBlack.png" alt="Search Students" border="0" /></a>
        <asp:TextBox id="windowMasterSearchBox" runat="server" placeholder="Enter Student Name..."/>
        <asp:Label id="windowMasterSearchBoxLabel" AssociatedControlId="windowMasterSearchBox" Text="Search: " runat="server"/>
    </div>

</form>

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