I have to create a series of controls(Hyperlink and Label) in .aspx file.The most important thing is that I have to control the ID of the generated control.
I write some code in my .aspx file like this:
<%for (int i =1; i <= 5; i++){%>
<asp:HyperLink ID="<%#GetContorlName("HyperLink",i,1)%>" CssClass="c083e01" runat="server">HyperLink</asp:HyperLink>
<%} %>
GetContorlName() is a function defined in codebehind file which return a string represent ID.
However,This doesn't work,It cannot compile.
Who can help me to fulfill this task?Please Remember I have to dynamically create controls in .aspx file,not in .cs file.
Any help will be appreciated!