我想在我的.aspx页面中调用.js文件的一个函数 [英] I want to call one function of .js file in my .aspx page

查看:363
本文介绍了我想在我的.aspx页面中调用.js文件的一个函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在drag.js文件中使用了ResizeFrame函数。

i需要我的Viewer.aspx中的ResizeFrame函数Page_Load。

解决方案

To从后面的代码调用javascript函数。检查下面的链接(第2点和第3点):



http://www.dotnetcurry.com/showarticle.aspx?ID=274 [ ^ ]


您无法从代码隐藏中调用javascript。您可以使用RegisterStartupScript将适当的代码添加到html中,以确保在页面加载到浏览器时调用js。



https://msdn.microsoft.com/en-us/library/z9h4dk8y(v=vs.110)。 aspx [ ^ ]

I hv ResizeFrame function in drag.js file.
i need this ResizeFrame function in my Viewer.aspx Page_Load.

解决方案

To call a javascript function from code behind. Check the link below (point no 2 and 3):

http://www.dotnetcurry.com/showarticle.aspx?ID=274[^]


You can't call javascript from code-behind. You can use RegisterStartupScript to add the appropriate code to the html to ensure the js is called when the page loads into the browser.

https://msdn.microsoft.com/en-us/library/z9h4dk8y(v=vs.110).aspx[^]


这篇关于我想在我的.aspx页面中调用.js文件的一个函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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