如何将后台代码中的变量的值传给客户端,并让它在客户端脚本中使用

liupeng1981 2003-07-25 11:42:49
如何将后台代码中的变量的值传给客户端,并让它在客户端脚本中使用
...全文
31 5 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
storm97 2003-07-25
  • 打赏
  • 举报
回复
把数组按照一定的格式格式化:
譬如将元素按照A+"|"+B的格式组织,然后需要用的时候再用string.split()来处理,
处理后的结果仍然为一个数组。
string.split(new char[]{'|'})
liupeng1981 2003-07-25
  • 打赏
  • 举报
回复
如果是数组的话 一样可以赋值.value属性吗
firewing 2003-07-25
  • 打赏
  • 举报
回复
<input type='button' value='<%=ButtonName%>' />
这样足够你用了吗?
雪狼1234567 2003-07-25
  • 打赏
  • 举报
回复
如上
atian25 2003-07-25
  • 打赏
  • 举报
回复
思归大哥回答我类似问题的原文:

you cannot get the mouse coordinates on the server side unless you submit them back, but it is not recommended, since the mouse-related messages are massive in quantity

try

labe1.innerText = dv2;

but the change will not be reflected on the server side, if you really want the value on the server side, use a hidden input control like
<form runat=server>
<input type=hidden id=hid runat=server>
...
</form>

on the client side in javascript:
document.all("hid").value = dv2;

on the server side, use hid.Value

111,097

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧