如何调用javascript函数.cs文件 [英] how to call javascript function .cs file
本文介绍了如何调用javascript函数.cs文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
i had javascript function i have to call that function from .cs file not at onclientclick only at button click event in .cs file
<pre lang="xml"><script type="text/javascript">
function RedirectPage()
{
var myForm = document.getElementById( "frmTransaction" );
if(myForm && myForm.action != null )
{
myForm.action = "https://secure.ebs.in/pg/ma/sale/pay/";
}
}
</script>
<script type="text/javascript"></pre>
推荐答案
在Google上搜索,您会发现很多完整代码的链接
link1 [ link2 [link3 [ ="_ blank" title ="New Window"> ^ ] ....
Search it on google and you will find a lot of links with the entire code
link1[^], link2[^], link3[^]....
您可以使用以下行来解决您的问题.但请确保您的母版页/内容页中存在ScriptManager
.
You can use the following line to solve your problem. But make sureScriptManager
exists in your master/content page.
ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "", "RedirectPage();", true);
有关更多信息,请单击此处
For further information please click here
这篇关于如何调用javascript函数.cs文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文