我的MVC视图中有两个动作链接,如下所示:
<%= Html.ActionLink
("click me","Partial1","Temp",new { s = "0" },new { id = "mylink" }) %>
<%= Html.ActionLink
("click me second link","Partial1", "Temp", null,
new { id = "mysecondlink" }) %>
我对这两个链接有四种风格。如果选择mylink我想要将#mylinkselected样式应用于它并且#mysecondlinknoselected应用于mysecondlink并且如果选择了mysecondlink,我想将#mysecondlinkselected应用于它并且#mylinknotselected to mylink
我无法更改ID,因为我在视图顶部有与这些链接相关的代码
<script type="text/javascript">
$(function() {
$('#mylink').click(function() {
$('#resultpartial1').load(this.href);
return false;
});
});
$(function() {
$('#mysecondlink').click(function() {
$('#resultpartial1').load(this.href, { s: "1" });
return false;
});
});
</script>
如何改变风格?
此致 Asif Hameed