Code
public partial class DefaultTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.HyperLink1.Attributes.Add("Selected", "false");
this.HyperLink1.Attributes.Add("onclick", "ChooseSubmit()");
}
else
{
Response.Write(this.HyperLink1.Attributes["Selected"].ToString());
}
}
}
Code
<head runat="server">
<title></title>
<script src="Script/jquery-1.2.6.js" type="text/javascript"></script>
<script type="text/javascript">
function ChooseSubmit() {
$('#HyperLink1').attr("Selected", "true");
form1.submit();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:HyperLink ID="HyperLink1" runat="server">HyperLink</asp:HyperLink>
</div>
</form>
</body>
</html>
我想输出客户端修改后的Selected=true;