如何更改Ajax Actionlink Linktext Mvc4 [英] How Do I Change Ajax Actionlink Linktext Mvc4

查看:59
本文介绍了如何更改Ajax Actionlink Linktext Mvc4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Asp.net MVC4应用程序,我在一种形式下使用ajax.Actionlink,



如下。





 <   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 = < span class =code-keyword> onclick = displaylabelforeighttable(); > 编辑< / a >

< / div >
< / h2 >







现在我想点击其他按钮更改LinkTextDemat Details(CDSL) 。





请帮助MVC专家。

解决方案

为Aax添加一个独特的css类名行动链接

< h2  class  =   headstep2_1> @ Ajax.ActionLink(  Demat详细信息(CDSL)   new  {ID =  99 }, new  AjaxOptions {OnSuccess =  }, new  {@class =    uniqueclass  floatleft LinkText})< /   h2  >  





然后按使用jquery你可以改变按钮点击事件中的文字

 


(document).ready(function(){


' #buttonId')。click(function(){

Hi, I am having Asp.net MVC4 application, and i am using ajax.Actionlink in one form,

as follows.


<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.

解决方案

Add a unique css class name to Aax action link

<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


(document).ready(function(){


('#buttonId').click(function(){


这篇关于如何更改Ajax Actionlink Linktext Mvc4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆