Asp Mvc 2 Dynamic Href By Javascript
Here is the deal: My link: <% =Html.ActionLink('Scheme', null, null, null, new { @id = 'schemeid' })%> JavaScript for changing href:
Solution 1:
First of all, try using Firefox and check "Console Errors" to see if you got any javascript error. Second, try this:
<script>
$(document).ready(function () {
document.getElementById('schemeid').href= "Test/ALL";
});
</script>
You'll need jQuery. Maybe your script is executing before rendering the tag.
Post a Comment for "Asp Mvc 2 Dynamic Href By Javascript"