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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T11:31:25+00:00 2026-06-06T11:31:25+00:00

Problem I have some pages that need dynamic data from website to generate output

  • 0

Problem

I have some pages that need dynamic data from website to generate output to users.

A simple solution is an aspx(php, …) page to generate data and create another html page serving as GUI retrieving data from first page and showing it to users. in this method I can call my GUI page for example form1.aspx and my data page form1.json.aspx.
although I personally like this method, it is not suitable when creating components for it.

Another method that currently I’m using is using same GUI page call itself with a querystring to retrieve data. this page should check for that query string and if it exists, only generate data and remove everything else from page. As an example for this method if I call my page form1.aspx, to retrieve data, I need to call it like form1.aspx?JSON

Here is an example of what I’m doing:

protected void Page_Load(object sender, EventArgs e) {
    if (Request.QueryString.ToString().IndexOf("JSON") == 0){
        this.Controls.Clear();
        Response.Clear();
        // send pure data to client
    } else {
      // render page as GUI
    }
}

However this method becomes too messy if I add master page and/or inherit my page from some template page. Master pages can only removed in Page_PreInit and that adds another extra method.

Security controls cause another problem, if user leaves page open for long time until session expires any attempt to retrieve data will fail cause security module will redirect the request to login page.

Next problem is I cannot consolidate my component in package because it needs modification in page (removing master page, clearing page components …).

What I’m looking for:

1- I’m looking for a solution that I can call my page and get pure data (JSON or XML format) and doing so run a server side method that generates data, so I don’t have to worry about what another designer puts in their master page or template.

2- I think it is possible to use axd extension to do this but I don’t have a clue about it and couldn’t find a helping document either.

3- Is there any better way of doing this. any suggestion or solution to improve this much appreciated.

  • 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-06T11:31:28+00:00Added an answer on June 6, 2026 at 11:31 am
    • Page methods. Check this article: http://weblogs.asp.net/craigshoemaker/archive/2008/09/29/using-jquery-to-call-asp-net-ajax-page-methods.aspx or http://encosia.com/using-jquery-to-directly-call-aspnet-ajax-page-methods/

    • WCF JSON service: http://www.codeproject.com/Articles/327420/WCF-REST-Service-with-JSON

    Other ways of doing is using an HTTP Handler. Implement IHttpHandler interface and register your implementation in your Web.config file. Later call it using jQuery ($.get / $.post):

    • http://msdn.microsoft.com/en-us/library/46c5ddfy.aspx

    EDIT
    As OP pointed out, in order to access session state in a page method you should use WebMethodAttribute this way:

    [WebMethod(EnableSession = true)]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a solution with multiple web projects, and there are some pages that
I have a script that runs on some pages. The problem is that I
I have some code that I'd like to run on a page. My problem
I have some problem's with a simple application in JSF 2.0. I try to
I have some problem with my cfml website. I have used the below code
I would like to scrape some dynamic data off of a website. On the
I have an ASP.NET user control that I want to write some dynamic Javascript
I need to create an algorithm to layout some hierarchical data but have never
I have added the JavaScript that I need to the bottom of my pages
I have some restricted pages built in Typo3. The problem is I cannot automatically

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.