Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6913029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:09:57+00:00 2026-05-27T09:09:57+00:00

Im creating some javascript items in a loop var licenseList = {}; $($licenses).each(function (index)

  • 0

Im creating some javascript items in a loop

var licenseList = {};

$($licenses).each(function (index) {

                var license = {};
                var editedValues = {};

                license.PRODUCT_KEY = $(this).parent('div.licensewrapper').data('productkey');

                $(this).find('input:text').each(function (i, val) {

                    if ($(val).attr('data-default-value') != $(val).val() && $(val).val() > 0 && $(val).data('isValid') != false) {

                        var pogKey = $(val).data('product_option_group_key');
                        var editedValue = $(val).val();

                        editedValues[pogKey] = editedValue;

                        license.editedValues = editedValues;

                    }

                });

    //licenseList[index] = license;
    //liceneList.push(license); //if array...
});

I’ve commented out my current solutions. But i dont think any of the two are equal to a generic list when derelializing them in c#. Whats the corrent way to do it in this case? Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T09:09:58+00:00Added an answer on May 27, 2026 at 9:09 am

    create your array

    var licenseList = [];
    

    for each of your licenses…

    var license = {
        prop1: 'p1',
        prop2: 'p2'
    };
    licenseList.push(license);
    

    format and serialize JSON data to be sent over to webmethod

    data = {
        LicenseList: licenseList
    };
    
    $.ajax({
          ...
          data: JSON.stringify(data)
          ...
          });
    

    in your webmethod your method parameter must match

    [WebMethod]
    public static string GetLicenses(List<License> LicenseList)
    {
       foreach(var license in LicenseList)
       {
         // do whatever
       }
    }
    

    sample license class. Your properties need to match with your objects in your javascript

    public class License
    {
       public string Prop1 {get; set;}
       public string Prop2 {get; set;}
    }
    

    Hope this helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating some HTML elements dynamically via JavaScript. Something line this: var author =
I'm looking for some Javascript jedi-master to assist in creating a function that adds
I am creating some elements in javascript like so: var parent = document.createElement('div'); parent.setAttribute('id',
I have some javascript that looks like this: var sel = '<option value={value} {selected}>{name}</option>';
I'm having some difficulties creating a javascript appointment style calendar. While it does render,
I am mlearning javascript and have some trouble creating an onject via prototype. I
I'm testing some cookies that I'm creating via JavaScript. Is there a way to
I'm creating some custom work items in TFS and the helptext field seems handy
I prefer creating my nav menus from markup (rather than Javascript), like in this
I am speed testing some JavaScript programs by creating a Date object, and using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.