Почему бы не использовать более простой синтаксис?
Это шаблон управления "Eval", который принимает выражение и формат строки:
protected internal string Eval(
string expression,
string format
)
The purpose of both controls is same. But there is one major difference between these two, i.e. HTML Hyperlink control is an HTML control, whenever it is clicked the page navigates to the target page. ASP.NET Link Button control is a server control, whenever the user clicks on it, the request is redirected back to the server and in its response the page is navigated to the target page.
Source .
The
control is a Web server control, while the link is the bare-bones HTML control.
Like all WebControls, the former provides a full featured programming event model, while the latter allows you to render an HTML anchor. You could add the runat="server"
attribute to the link control to enable it to be accessed in server-side code. This attribute would however be required for the Hyperlink
control (because it is a ASP.NET object that renders as an hyperlink in HTML.