从代码隐藏文件调用Jquery [英] Call Jquery from Code Behind file

查看:80
本文介绍了从代码隐藏文件调用Jquery的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个用户控件,以使用JQuery格式化数字,如十进制,百分比,价格等.那么,能否请您告诉我如何从(.ascx.cs)文件后面的代码中调用Jquery函数?

提前谢谢.

问候,

Dipti Chalke

I want to create a user control for formatting the number like in decimal,percentage,price etc. by using JQuery. So can you please tell me how to call Jquery function from code behind (.ascx.cs) file?

Thanks in advance.

Regards,

Dipti Chalke

推荐答案

尝试使用 Page.RegisterStartupScript方法 [ ^ ]

使用它们,您可以根据特定条件(特定于页面)从服务器端将脚本注入到页面中.
有关如何使用它的示例:如何使用RegisterClientScriptBlock& RegisterStartupScript [^ ]
示例2 [
Try using Page.RegisterClientScriptBlock Method [^] OR Page.RegisterStartupScript Method[^]

Using them, you can inject the scripts into a page from server side and based on certain condition (and specific to page.)
For samples on how to use it: How to Use RegisterClientScriptBlock & RegisterStartupScript[^]
Sample 2[^]

Using them, you can call jQuery methods from code behind.


这篇关于从代码隐藏文件调用Jquery的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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