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 7871065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T01:47:57+00:00 2026-06-03T01:47:57+00:00

My Jquery code is given below $(#btnExec).live(‘click’, function () { var data1= lorem ipsum;

  • 0

My Jquery code is given below

 $("#btnExec").live('click', function () {
       var data1= "lorem ipsum";
       var data2= "lorem ipsum";
       var data3= "lorem ipsum";
       var dict = new Object();

       $("#ArgsTable tr").each(function (e) {
                var firstTD = $(this).find("td").eq("0").html().trim().replace(/\s/g, "");
                var secondValue = $(this).find("td").eq("1").find("input:text").val();
                dict[e] = [firstTD,secondValue]; 
       });

       $.ajax({
                type: 'POST',
                cache: false,
                data: { strdata1: data1, strdata2: data2, strdata3: data3, myDictionary: dict },    
                url: '<%=Url.Action("ExecData","Home") %>',
                success: function (data) {        
                }
              });
 });

And my controller method is given below

public string ExecData(string strdata1, string strdata2, string strdata3,  Dictionary<object, object> myDictionary)
{
    //do some stuff...
}

If i click btnExec means, its fired the controller method with string values properly, but the dictionary values come always null ..

In my scenario “the return type of controller method should be string only”

How can i solve this? Thanks in advance !!!

  • 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-06-03T01:47:59+00:00Added an answer on June 3, 2026 at 1:47 am

    Tyr like this:

    [HttpPost]
    public ActionResult ExecData(
        string strdata1, 
        string strdata2,  
        string strdata3, 
        Dictionary<string, string> myDictionary
    )
    {
        return Content("hello world");
    }
    

    and then:

    var data = {
        strdata1: 'lorem ipsum',
        strdata2: 'lorem ipsum',
        strdata3: 'lorem ipsum'
    };
    
    $('#ArgsTable tr').each(function (index, item) {
        var firstTD = $(this).find('td').eq(0).html().trim().replace(/\s/g, '');
        var secondValue = $(this).find('td').eq(1).find('input:text').val();
        data['myDictionary[' + index + '].Key'] = firstTD;
        data['myDictionary[' + index + '].Value'] = secondValue;
    });
    
    $.ajax({
        url: '<%=Url.Action("ExecData","Home") %>',
        type: 'POST',
        traditional: true,
        data: data,
        success: function (result) {
    
        }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following jquery code.. jQuery.fn.sliding = function () { return this.each(function () {
jQuery Code: $(document).ready(function(){ $.getJSON('dat.js', function(data) { var obj = JSON.parse(data); alert(obj[0].title); }); }); My
Jquery Code: $(.tog).toggle( function() { $(.tog span).removeClass('stog'); $(.tog span).addClass('stogm'); $(this).next().slideDown('fast'); }, function() { $(.tog
My jQuery code: $(document).ready(function() { chrome.extension.sendRequest({get: height}, function(response) { height = response.value; }); $(#id).css(height,
This is my jQuery code: $.ajax({ type: POST, url: process.php, success: function(msg){ } });
I have an HTML code as given below. I want to select all td
I want to create dynamic html which needs to render as code given below:
Using jquery I have the function below. When the button is clicked it slides
I have got below JQuery where I am performing the .load function. $(.load-fragment).each(function() {
my jquery code not run with IE6 but runs all others including IE7. It

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.