如何调用从C#javascript函数 [英] How to call javascript function from c#
本文介绍了如何调用从C#javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢称之为从C#的JavaScript函数。任何一个可以给我code片段。
I like to call a JavaScript function from c#. Can any one can give me code snippet.
更多详细信息...
我有其中有一个asp的按钮asp.net页面。当我点击该按钮,我喜欢叫javascript函数。
I have a asp.net page which has a asp button. when i click that button, i like to call javascript function.
喜欢聪明....
在我的asp.net页面,
in my asp.net page,
<button id="save" onclick="i like to call a method resides in asp.net page'>Save</button>
越来越多的细节......
点击asp.net按钮时,我想执行一些服务器端的操作,然后想从那里本身...
More and more details... when click the asp.net button, i like to perform some server side action and then like to call a javascript function from there itself...
推荐答案
对于 ASP:按钮
使用<一个href=\"http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.button.onclientclick.aspx\">OnClientClick
<asp:Button id="myid" runat="server" OnClientClick="alert('test')" />
这篇关于如何调用从C#javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文