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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:03:09+00:00 2026-05-24T23:03:09+00:00

recently i uploaded my application to production server, which have ajax jquery calling my

  • 0

recently i uploaded my application to production server, which have ajax jquery calling my webmethod… its running fine… on development but on production i gets folloewing error:

< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
< html xmlns="w3.org/1999/xhtml">  
 < head>< title> 
</ title>< /head> < body> < form name="form1" method="post" action="AddPollAJax.aspx" id="form1" >  < div > < input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="hP8DrZMpHGeABurXdr2IcRY8jMzK+5Ayj3BI0bptYaeZn7amHg1E4nNUCVS1+ScBxUQNKDzsG‌ ​gfP3Fnv7yq7JtdZV3o=" / > < /div > < div > < input type="hidden" name="__VIEWSTATEENCRYPTED" id="__VIEWSTATEENCRYPTED" value="" / > < /div > < div > < /div > < /form > < /body > < /html >

below is my webmethod

[WebMethod]
    public static Poll[] GetPollDetails(int pageSize, int currentPage)
    {
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["SiteSqlServer"].ConnectionString);
        SqlDataAdapter da = new SqlDataAdapter("sp_GetCollectionForPoll", con);
        da.SelectCommand.CommandType = CommandType.StoredProcedure;
        da.SelectCommand.Parameters.AddWithValue("@PageSize", pageSize);
        da.SelectCommand.Parameters.AddWithValue("@CurrentPage", currentPage);
        da.SelectCommand.Parameters.AddWithValue("@siteid", 1);
        DataSet dt = new DataSet();
        da.Fill(dt);
        List<Poll> _poll1 = new List<Poll>();
        foreach (DataRow row in dt.Tables[0].Rows)
        {
            Poll _poll = new Poll();
            _poll.QuestionID = Convert.ToInt32(row["questionID"]);
            _poll.Question = Utils.RemoveHtmlTags(row["question"].ToString());
            _poll.Published = row["Published"].ToString();
            _poll.Date = row["Date"].ToString();
            _poll.TotalRecords = Convert.ToInt32(dt.Tables[1].Rows[0]["TotalRow"].ToString());
            _poll.AnswerCount = Convert.ToInt32(row["AnsCount"].ToString());
            _poll1.Add(_poll);
        }
        return _poll1.ToArray();
    }

and my javascript function

 function GetPolls(pageSize, currentPage) {
        if (currentPage < 1) {
            alert("You are currently Viewing First Page cannot go back");
            return false;
        }

        try {
            $.ajax({
                type: "POST",
                url: "AddPollAJax.aspx/GetPollDetails",
                data: "{'pageSize':'" + pageSize + "','currentPage':'" + currentPage + "'}",
                contentType: "application/json",
                dataType: "json",
                success: function (msg) {
                    var data = msg.d;
                    if (_totalRecords == 0) {
                        _totalRecords = data[0].TotalRecords;
                    }
                    var totalPage = Math.ceil(_totalRecords / pageSize);
                    if (currentPage > totalPage) {
                        alert("You are currently viewing last page, cannot go forward");
                        return false;
                    }
                    var s = "<table border='0' width='100%' cellpadding='5' style='border-collapse:collapse'><thead><tr style='background-color:#C4F3E3'><th>EDIT</th><th>ID</th><th>Question</th><th>Options</th><th>Created Date</th><th>Published</th></tr></thead><tfoot width='100%' style='background-color:#C4F3E3'><tr><td colspan='6' align='center'><input type='button' style='font:normal 15px ALGERIAN, arial;' border='solid 0px' id='btnPrevious' onclick='GetPolls(" + $("#pageSize").val() + "," + (parseInt(currentPage) - 1) + ")' id='btnPrevious' value='PREVIOUS' />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type='button' style='font:normal 15px ALGERIAN, arial' id='btnNext' onclick='GetPolls(" + $("#pageSize").val() + "," + (parseInt(currentPage) + 1) + ")' value='NEXT' /></td><tr></tfoot><tbody>";
                    var iChecked;
                    for (i = 0; i < data.length; i++) {
                        if (data[i].Published == "True") { iChecked = "checked" } else { iChecked = "" };
                        if (i % 2 != 0) {
                            s += "<tr style='background-color:#C4F3E3'><td width='7%' align='center'><img type='button' style='cursor:pointer' src='/images/edit.gif' value='EDIT' onclick='getData(" + data[i].QuestionID + ")' />&nbsp;&nbsp;<img type='button' style='cursor:pointer' src='/images/delete.gif' value='EDIT' onclick='DeletePollQuestion(" + data[i].QuestionID + ")' /></td><td width='2%' align='center' class='gridText'>" + data[i].QuestionID + "</td><td style='padding-left:5px;' class='gridText'>" + data[i].Question + "</td><td valign='middle' width='5%' align='center' class='gridText'>" + data[i].AnswerCount + "</td><td width='10%' align='center' class='gridText'>" + data[i].Date + "</td><td width='10%' align='center'><input type='checkBox' " + iChecked + " disabled=disabled></td></tr>";
                        }
                        else {
                            s += "<tr style='background-color:#74DDB7'><td width='7%' align='center'><img type='button' style='cursor:pointer' src='/images/edit.gif' value='EDIT' onclick='getData(" + data[i].QuestionID + ")' />&nbsp;&nbsp;<img type='button' style='cursor:pointer' src='/images/delete.gif' value='EDIT' onclick='DeletePollQuestion(" + data[i].QuestionID + ")' /></td><td width='2%' align='center' class='gridText'>" + data[i].QuestionID + "</td><td style='padding-left:5px;' class='gridText'>" + data[i].Question + "</td><td valign='middle' width='5%' align='center' class='gridText'>" + data[i].AnswerCount + "</td><td width='10%' align='center' class='gridText'>" + data[i].Date + "</td><td width='10%' align='center'><input type='checkBox' " + iChecked + " disabled=disabled></td></tr>";
                        }
                    }
                    s += "</tbody></table>";
                    document.getElementById("jqGrid").innerHTML = s;
                },
                error: function (data) {
                    alert("Error: " + data.responseText);
                }
            });
        }
        catch (err) {
            alert(err.Description);
        }
    }

can anyone help me for this error:

  • 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-24T23:03:10+00:00Added an answer on May 24, 2026 at 11:03 pm

    intsead of

    return _poll1.ToArray();
    

    only use

    return _poll1();
    

    Javascript serializer will automatically convert in into JSON object.

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

Sidebar

Related Questions

Hello I have recently uploaded an application to the app store and it got
I have an application in which I have manually uploaded videos using Youtube Data
I have just uploaded my published application files to my web server but I
I am running a J2EE web application in Tomcat, and recently I have been
I recently uploaded my application to the android market however it's refusing to run
I recently uploaded my ASP.NET MVC 2 Preview 2/.NET 4 application (Built using VS
Recently I have been investigating the possibilities of caching in ASP.NET. I rolled my
Recently, I started changing some of our applications to support MS SQL Server as
Recently we got a new server at the office purely for testing purposes. It
Recently I ran into this error in my web application: java.lang.OutOfMemoryError: PermGen space It's

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.