如何将 Java 脚本中的值分配给系统类中的属性 [英] how to assign values from Java script to a Property in a system class

查看:16
本文介绍了如何将 Java 脚本中的值分配给系统类中的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用于生成一些值的 Java 脚本

I have a Java Script where I produce some values

    productionHandler._SelFileAttributes.Add(fullPath);
productionHandler._SelFileAttributes.Add(objfile.files[0].name);
productionHandler._SelFileAttributes.Add(objfile.files[0].size);
productionHandler._SelFileAttributes.Add(objfile.files[0].type);

我也有一个类,我有一个属性

I also have a Class where I have a Property

Public Property _SelFileAttributes As ArrayList
Get
    Return SelFileAttributes
End Get
 Set(value As ArrayList)
    SelFileAttributes = value
 End Set
End Property

我想要的是将值从 Java Script 发送到类中的属性

What I want is to send the values from Java Script to the property in the Class

推荐答案

首先我点击隐藏的 upload 按钮控件,它需要是 <asp:FileUpload...
使用 Java 脚本(总是)我得到了这个隐藏控件的值.
并传入另一个隐藏按钮的值.

First I'm clicking the hidden upload button control which needs to be as <asp:FileUpload...
Using Java script (always) I get the value of this hidden control.
And passed in the value of another hidden button like that.

<asp:HiddenField runat="server" ID="AddAttrib" Value=""  OnValueChanged="AddAttrib_ValueChanged" />

正如我们通过使用 OnValueChanged 事件所看到的,我在后面的代码中捕获了它.
从那里一切都很容易谢谢大家

As we can see by using the OnValueChanged event I capture it in the code behind.
From there all it is very easy Thank all

这篇关于如何将 Java 脚本中的值分配给系统类中的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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