Click here to Skip to main content
15,895,667 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a Java Script where I produce some values

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

I also have a Class where I have a `Property` named <SelFileAttributes>
Public Property _SelFileAttributes As ArrayList
Get
    Return SelFileAttributes
End Get
 Set(value As ArrayList)
    SelFileAttributes = value
 End Set
End Property

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

What I have tried:

I have used this but without any effect

var proHandler = {
      proHandler : "ProductionHandler",
      showUrlLink: function() {
      if ( this.proHandler === "ProductionHandler") {
      prodHandler._SelFileAttributes.Add(fullPath);
      prodHandler._SelFileAttributes.Add(objfile.files[0].name);
      prodHandler._SelFileAttributes.Add(objfile.files[0].size);
      prodHandler._SelFileAttributes.Add(objfile.files[0].type);
                                }
                   }
    }
Posted
Updated 24-Jan-19 10:50am
v2
Comments
F-ES Sitecore 24-Jan-19 12:32pm    
Javascript runs on the client, your class exists on the server so the two have no knowledge of each other.

The only way to make a class on your server code be populated with values from the client javascript is to submit those values to the server via a form post or an ajax call and populate the object from there.

This is one of those situations where what you're doing, or want to do, makes no sense. You should explain what it is you're trying to achieve over all and someone might have an idea how to do it.
Lefteris Gkinis 24-Jan-19 14:15pm    
What I want o achieve is to assign four values from Javascript to a `property` named `_SelFileAttributes` in a system class named `Production`
Dave Kreskowiak 24-Jan-19 15:03pm    
F-ES Sitescore already told you what you have to do. The only way you're going to get values sent back to the server-side code is via a POST or AJAX call to a method your website code exposes for the purpose.
Lefteris Gkinis 24-Jan-19 15:21pm    
Please give me an assistance with code
Dave Kreskowiak 24-Jan-19 17:28pm    
Can't give any code. There's too much that we don't know about your current implementation.

Google: javascript ajax call[^]

Google: VB.NET MVC ajax controller method[^]

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900