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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:31:11+00:00 2026-05-25T17:31:11+00:00

i am having a strange problem, while calling ajax jquery in asp.net.. i am

  • 0

i am having a strange problem, while calling ajax jquery in asp.net.. i am getting the parseError, and this is not expected, because everything is in place.

below is my webmethod.

public class MyLogic
{
    private int _id;

    public int Id
    {
        get { return _id; }
        set { _id = value; }
    }
    private string _title, _image;

    public string Image
    {
        get { return _image; }
        set { _image = value; }
    }

    public string Title
    {
        get { return _title; }
        set { _title = value; }
    }
}

below is the method i am calling

[WebMethod]
    public static MyLogic[] GetTopArticles()
    {
        List<MyLogic> bList = new List<MyLogic>();
        SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["MobileKeyboardConnection"].ConnectionString);
        SqlDataAdapter adapTopStories = new SqlDataAdapter("m_sp_toparticles", con);
        adapTopStories.SelectCommand.CommandType = CommandType.StoredProcedure;
        adapTopStories.SelectCommand.Parameters.AddWithValue("@PortalId", 2);
        adapTopStories.SelectCommand.Parameters.AddWithValue("@topValue", 5);
        DataTable dtTopStories = new DataTable();
        adapTopStories.Fill(dtTopStories);
        foreach (DataRow r in dtTopStories.Rows)
        {
            MyLogic c = new MyLogic();
            c.Id = Convert.ToInt32(r["Id"]);
            c.Title = r["Title"].ToString();
            c.Image = r["image"].ToString();
            bList.Add(c);
        }
        return bList.ToArray();
    }

and below is the design.

<script type="text/javascript">
    $(document).ready(function () {
        $.ajax({
            type: "POST",
            url: "AjaxLogic.aspx/GetTopArticles",
            dataType: "json",
            contentType: "application/json; charset=utf-8",
            data: "{}",
            success: function (data) {
                var result = data.d;
                alert(result.length);
            },
            error: function (data) {
                alert(data.responseText);
            }
        });
    });
</script>

Please any know what could be issue
i am using core asp.net and master pages in my application.

******************JSON RESPONSE*****************

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title></head>
<body>
    <form name="form1" method="post" action="AjaxLogic.aspx" id="form1">
<div>
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwULLTE2MTY2ODcyMjlkZPKFQelTZBrnZbMRGP+4imyXfwO4" />
</div>

    <div>

    </div>
    </form>
</body>
</html>
  • 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-25T17:31:11+00:00Added an answer on May 25, 2026 at 5:31 pm

    Try replacing:

    data: {},
    

    by:

    data: '{}',
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having a strange problem here... I have an ASP.NET 3.5 application that has
I am having a strange problem while returning a string. it says can not
I've been having a strange problem with CoreData for a while now. This will
i am having a strange problem, i have a static class like this public
I'm having a strange problem while attempting to transform a blocking socket server into
I am having a rather strange problem, I deployed 2 .NET applications on my
This is a strange problem that I am having with WCF trying to send
I am having a strange problem while making an application in iPhone. The problem
I am facing this strange problem while working with Generic Base Classes. I am
I'm having this strange(?) problem. When I run the selenium server (2.0rc3), after a

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.