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
  • 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-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 have a view that has a list of jobs in it, with data
When I goto view the property page for my CSharp test application I get
I'd like to view historical data for guest cpu/memory/IO usage, rather than just current
Under the View-Model-ViewModel pattern for WPF, I am trying to databind the Heights and
Basically I have this In my Asp.net controller public ActionResult RenderMyView() { data =
I have this in my view: string_location = myaddress2 geodata = [] for place,
In my controller i have an action which does not have a corresponding view.
View this code: function testprecision(){ var isNotNumber = parseFloat('1.3').toPrecision(6); alert(typeof isNotNumber); //=> string }
Django view points to a function, which can be a problem if you want
My view-state to action-state transition does not appear to be happening. In the following

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.