我已经在锚标记中添加了id,我想在我的c#代码中使用此id来更改类名。如何给id并访问asp.net html页面中的锚标签?
但是,我得到一个解析错误 -
<a runat="server" id="btn_status_toggle"
class="btn btn-success" data-toggle="modal"
data-target="#myModal"
onclick="fun(<%# Eval("ID")%>)">Status</a>
我不知道是什么问题。
Server Error in '/' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: The server tag is not well formed.
Source Error:
Line 95:
Line 96: &RoleName=<%# Eval("RoleName")%>'>Edit Line 97: )">Status Line 98: Line 99:Source File: /ShowAdminData.aspx Line: 97
这个锚在哪里? (例如在一个gridview内?) – Aristos
什么是乐趣()?是javascript函数还是c#类中的方法 – Usman