如何从javascript函数检索值 [英] how to retrieve values from javascript function
本文介绍了如何从javascript函数检索值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何从javascript函数将值检索到服务器asp.net,例如
javascript函数
how to retrieve values from javascript function to server asp.net for ie
javascript function
<script type="text/javascript">
function action() {
var x = 34.4534534;
var y = -12.3345335;
var z = x.toString() + ',' + y.toString();
alert(z);
}
</script>
服务器端功能
serverside function
ScriptManager.RegisterStartupScript(this, Page.GetType(), "anykey", "action()", true);
我试图这样做,以便调用客户端功能,以便我可以获取值.但是我做不到.
如何将action方法的值检索到服务器函数.
预先感谢
i was trying like this in order to call client side function so i can get the values . but i am unable to do it .
how to retrieve the values of the action method to a server function .
thanks in advance
推荐答案
将结果存储在JavaScript函数的隐藏字段中,并从服务器(在回发之后)访问该隐藏字段.
Store the result in a hidden field in the JavaScript function and access the hidden field from the server (after a postback).
这篇关于如何从javascript函数检索值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文