0

Here is the deal:

My link:

<li><% =Html.ActionLink("Scheme", null, null, null, new { @id = "schemeid" })%></li>

JavaScript for changing href:

<script>
    document.getElementById('schemeid').href= "Test/ALL";
</script>

Its working in any browser on ASP.NET dev.server on vs2010; but when i host it on iis 7. it fails. and in source of web page i have href=""

can any one help?

3
  • Isn't the second (or third?) parameter in that overload supposed to be "Controller" ? Commented Aug 22, 2010 at 15:04
  • Where in the page is this script block located? Commented Aug 22, 2010 at 15:04
  • 1. yes supposed. but itwhen i write test/all that means test-controller, all-action. 2. in the middle Commented Aug 22, 2010 at 15:17

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

thx. but. firebug doesnt show anything. and jquery didnt help.
0

found solution. thx to every body. here is answer:

document.getElementById('list').innerHTML='<% =Html.ActionLink("Scheme","ALL","Test")%>';

<li id="list"><% =Html.ActionLink("Scheme", null, null)%></li>    

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.