如何从Javascript函数中的C#中获取变量 [英] How Do I Fetch Variable From C# In Javascript Function

查看:60
本文介绍了如何从Javascript函数中的C#中获取变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的变量是

My variable is

public string Coordinate5a;



如果条件我正在为Coordinate5a赋值如下:




inside if condition i am assigning value to Coordinate5a like this:

if(res==ddlnetworkName)
 {
        Coordinate5a = alLatitude[2].ToString();
 }





以下代码在javascript中





The Following code is inside javascript

var c5a = '<%=Coordinate5a%>';





但输出我得到''( null)当我调试代码



But output i am getting as ''(null) when i debug the code

推荐答案

<dx:aspxcheckbox id="ASPxCheckBox4" text="KeyStroke" clientinstancename="KeyStroke" runat="server" xmlns:dx="#unknown">
                                                           <clientsideevents checkedchanged="function(s,e){ ShowLoadingPanel();strShowKeyStroke=s.GetChecked(); keyStroke();}" />
                                                       </dx:aspxcheckbox>


这篇关于如何从Javascript函数中的C#中获取变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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