在后面的JavaScript属性抓斗code? [英] Grab code behind property in Javascript?

查看:113
本文介绍了在后面的JavaScript属性抓斗code?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在C#code身后财产刻录成JavaScript警告(小于(%)= someProperty%>); 。出于某种原因,它不工作。有没有可以在codebehind财产刻录成的JavaScript的方法吗?谢谢

I would like to burn in a c# code behind property into the javascript alert(<%= someProperty%>); . For some reason it is not working. Is there a way you can burn the codebehind property into the javascript? thanks

推荐答案

不知道这工作在你的情况,但我认为你最好的选择可能是对JavaScript动态附加到事件中的code背后页面加载,只是在该点设置的参数值。

Not sure if this works in your situation, but I think your best bet might be to attach the javascript to the event dynamically in your code behind on page load and just set the parameter value at that point.

例如:

btnSubmit.Attributes.Add("onclick","alert(" + someProperty + ");");

这篇关于在后面的JavaScript属性抓斗code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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