Click here to Skip to main content
15,914,221 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am having Asp.net MVC4 application, and i am using ajax.Actionlink in one form,

as follows.


XML
<h2 class="headstep2_1">@Ajax.ActionLink("Demat Details (CDSL)", "", "", new { ID = 99 }, new AjaxOptions { OnSuccess = " " }, new { @class = "floatleft LinkText" })

    <div class="editDiv">
        <a href="#" id="" onclick="displaylabelforeighttable();">Edit</a>

    </div>
</h2>



Now I want to change LinkText "Demat Details (CDSL)" on Click of other button.


Please help MVC Experts.
Posted
Comments
Nathan Minier 21-Nov-14 6:56am    
It sort of depends on what you want to change it to. Is it based on a resource name, a text entry, a static value....

1 solution

Add a unique css class name to Aax action link
C#
<h2 class="headstep2_1">@Ajax.ActionLink("Demat Details (CDSL)", "", "", new { ID = 99 }, new AjaxOptions { OnSuccess = " " }, new { @class = "uniqueclass floatleft LinkText" })</h2>


and then by using jquery you can change the text in button click event
C#
$(document).ready(function(){
$('#buttonId').click(function(){
$(".uniqueclass").text("Your New Text") 
});
});

Hope this helps
 
Share this answer
 
Comments
Member 10004269 21-Nov-14 7:38am    
Thanks Jameel VM , it worked like a Charm....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900