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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:39:59+00:00 2026-05-18T02:39:59+00:00

When I view my response I have my json data but at the bottom

  • 0

When I view my response I have my json data but at the bottom i’ve got the html of the page? I’m trying to create a JSON response any spot something obvious. All i’ve done is create a blank .aspx page.

       protected void Page_Load(object sender, EventArgs e){ Database db = DatabaseFactory.CreateDatabase();
        DbCommand cmd = db.GetStoredProcCommand("sp_GET_FEED");
        db.AddInParameter(cmd, "@FEED_TYPE_ID", DbType.Int32, 1);

        List<NewsItem> _NewsItems = new List<NewsItem>() ;

        using (IDataReader r = db.ExecuteReader(cmd))
        {
            while (r.Read())
            {
                NewsItem i = new NewsItem();
                i.id = r["FEED_ID"].ToString();
                i.title = r["TITLE"].ToString();
                i.fulltext = r["BODY"].ToString();
                i.image = r["IMAGE_URL"].ToString();
                i.created = r["DATE_CREATED"].ToString();
                i.url = r["URL"].ToString();
                _NewsItems.Add(i);
            }
        }

        string json = JsonConvert.SerializeObject(_NewsItems);
        //Response.Clear();
        Response.AddHeader("Content-type", "text/json");
        Response.AddHeader("Content-type", "application/json");
        Response.ContentType = "application/json";
        Response.Write(json);}

so my resposne is

///////////////////////////////JSON Output which looks correct//////////////////////////////

< html>
balhhhh which I don’t need for my response as it’s should be a feed of JSON data.
< /html>

  • 1 1 Answer
  • 1 View
  • 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-18T02:40:00+00:00Added an answer on May 18, 2026 at 2:40 am

    Try calling

    Response.End();
    

    after Response.Write(). This will prevent the rest of ASP.NET from adding HTML from the page.

    Alternatively, if you never want to render the actual page, you should probably consider writing an ASP.NET Handler (.ashx) instead of a page (.aspx) in the first place.

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

Sidebar

Related Questions

I'm trying to return a JSON response from a Django view call via an
I have a response object which I want to convert to Json, but somehow
In my application I have the array, which create in Main_View_Controller from json response
I'm trying to view a users tweets from my app but twitter responses with
I have got jquery post function jQuery('.more-button').live('click', function(eve){ var page = jQuery(this).attr('id').replace('more-button-',''); loaded_messages +=
I am trying to use JSON and HTTP client to retrieve data from a
I have this following view which I get data from a model and thereafter
I have two URLs: http://s140452.gridserver.com/view-pullsheet/ https://s140452.gridserver.com/locations/ When browsing through any properties on the locations
I'm trying to render an html table using underscore template engine. First I have
On my main edit view I have 3 partial views that contain child data

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.