There is a .aspx page in the web application which doesnt have the code behind file(.cs). it is located in a folder named staticcontentbelow is aspx markup
<%@ Page Title="" Language="C#" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
</head>
<body>
<form action='searchdata.aspx' method='post'>
<input type='text' value='' id='searchText' />
<button id='btnSearch'>Search</button>
</form>
</body>
</html>
Now I want to move this search text box to asp.net and register on this page.
However, it does not compile.
It still displays the syntax of the user control only
<%@ Register Src="~/controls/EmpSearch.ascx" TagName="search" TagPrefix="emp" %>
<emp:search runat="server" ID="searchCtrl"></emp:search>
Highlighted HTML
<body>
This contains only static text and there is no dynamic data
Employee Search
<emp:search runat="server" ID="searchCtrl"></emp:search>
</body>
Tried to use <!--#include file="~/controls/EmpSearch.ascx"-->inaction.
Why the .aspx page does not compile here.
.csproj has only <Content Include="StaticContent\Employee.aspx" />
and does not have
<Compile Include="StaticContent\Employee.aspx.cs">
since he has no code for
source
share