动态更改cshtml上的css [英] Dynamically change the css on cshtml

查看:347
本文介绍了动态更改cshtml上的css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





如何在CSHTML页面上动态更改actionLink控件的css。

假设,我得到了一个CSHTML页面上的type参数和这个type参数基础我想在CSHTML页面上更改ActionLink的CSS。

请建议。



谢谢,



问候,

Ashish

Hi,

How could I dynamically change the css of a actionLink control on CSHTML page.
Suppose, I am getting a "type" parameter on the CSHTML page and on this "type" parameter basis I want to change the css of "ActionLink" on a CSHTML page.
Please suggest.

Thank you,

Regards,
Ashish

推荐答案

Actionlink实际上是一个锚点链接



使用JQuery你可以做到。


Actionlink is actually an anchor link

using JQuery you can do it.


(input ['type = myaction'])。attr('class','newclass');






("input['type=myaction']").attr('class','newclass');

or


(input ['type = myaction'])。 css('background-color:','red');






("input['type=myaction']").css('background-color:','red');

or

这篇关于动态更改cshtml上的css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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