I have two actionlinks on my MVC view like this:
<%= Html.ActionLink
("click me","Partial1","Temp",new { s = "0" },new { id = "mylink" }) %>
<%= Html.ActionLink
("click me second link","Partial1", "Temp", null,
new { id = "mysecondlink" }) %>
and I have four style for these two links. if mylink is slected i want to apply #mylinkselected style to it and #mysecondlinknoselected to mysecondlink and if mysecondlink is selected, I want to apply #mysecondlinkselected to it and #mylinknotselected to mylink
I can not change the ids as I have code related to these links at top of view
<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>
how to change styles ?
Regards,
Asif Hameed
Your best bet is probably to just set an
A:activestyle for the links. This will apply that style to whichever link is clicked.http://www.echoecho.com/csslinks.htm