通过System.Windows.Forms.UserControl调用javascript [英] Calling javascript through a System.Windows.Forms.UserControl

查看:55
本文介绍了通过System.Windows.Forms.UserControl调用javascript的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我在VS2005中创建了一个类库项目.
我创建了带有按钮的Windows窗体用户控件.
构建后,将为该用户控件创建DLL.
我从IE上的Web服务器使用对象标记加载DLL.

我需要的是在单击按钮时调用javascript.
有什么办法可以做到吗?


感谢您的努力:)

Hello All,

I created a class library project in VS2005.
i created windows form user control with a button on it.
when built a DLL is being created for that user control.
i load DLL using object tag from a web server on IE.

what i need is to call javascript when i click on button.
is there any way to do this ???


Will appreciate for ur efforts :)

推荐答案

不需要自定义控件,只需使用[button] .OnClientClick.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx [
There is no need for a custom control, just use [button].OnClientClick.
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx[^]


提供的链接使用未使用的Web控件.
在我的情况下,有一个HTML页面,该页面具有用于
的HTML对象TAG 在浏览器中将控件作为DLL嵌入.
the link which is provided uses web controls which am not using.
in my case there is HTML page which has HTML object TAG used to
embed controls as DLL on browser.


也许此链接会为您提供帮助.

从ASP.NET服务器控件中注入客户端脚本 [
Maybe this link will help you out.

Injecting Client-Side Script from an ASP.NET Server Control[^]


这篇关于通过System.Windows.Forms.UserControl调用javascript的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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