我正在尝试在 asp.net webform 页面(.aspx)中的服务器控件中使用变量。我收到语法错误。可能是什么问题?
<%string msgCancelProject = "You are not authorized to cancel the project."; %>
<asp:Button ID="CancelProject" <%if(IsAuthorized){%> title="<% =msgCancelProject %>" clickDisabled="disable" <%}%> runat="server" Text="Cancel Project"
OnClick="btnCancelProject_Click"
OnClientClick="return confirm('Are you certain you want to cancel the record?');" />