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

  • Home
  • SEARCH
  • 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 6880451
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:58:33+00:00 2026-05-27T04:58:33+00:00

am currently using google feed api to get feed links dynamically. am trying to

  • 0

am currently using google feed api to get feed links dynamically. am trying to use the results returned by the api to create rss feed for my website..Now the problem is api function call takes place only after the page load so i cant access the url values returned by the api in page load function..

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
   <script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAxII5vpTAk5gatTPIMAFoCxStIDvCAqMV0_KActMytIL1qEezxxQeBqRzIurcFfnrUgG2YMlC07VgbQ"></script>
    <script type="text/javascript">

        google.load("feeds", "1", { "callback": OnLoad });

        function OnLoad() {
            // Query for president feeds on cnn.com
            var query = 'atlanta bridal shows';
            google.feeds.findFeeds(query, findDone);
        }

        function findDone(result) {
            // Make sure we didn't get an error.
            if (!result.error) {
                // Get content div
                var content = document.getElementById('content');
                var html = '';
                var submenu = new Array()
                // Loop through the results and print out the title of the feed and link to
                // the url.
                for (var i = 0; i < result.entries.length; i++) {
                    var entry = result.entries[i];
                    html += '<p><a href="' + entry.url + '">' + entry.title + '</a></p>';
                    submenu[i] = entry.url;
                }
                content.innerHTML = html;

                document.getElementById('<%= Hidden1.ClientID %>').value = submenu;
            }
        }

        google.setOnLoadCallback(OnLoad);
    </script>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<asp:HiddenField ID="Hidden1" runat="server" ondatabinding="Hidden1_DataBinding" 
        onunload="Hidden1_Unload" onvaluechanged="Hidden1_ValueChanged" />
<div id="content"></div>

</asp:Content>

pageload event:

 protected void Page_Load(object sender, EventArgs e)
    {
        WebClient client = new WebClient();
        string path = Request.Url.GetLeftPart(UriPartial.Authority) +
               VirtualPathUtility.ToAbsolute("~/user/feed.htm");

        Stream stream = client.OpenRead(path);
        StreamReader sr = new StreamReader(stream);
        string content = sr.ReadToEnd();

          }

What should i do to access the values returned by the api in page load??

  • 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-27T04:58:33+00:00Added an answer on May 27, 2026 at 4:58 am

    First of all you have to create feed.htm and put above code in it.

    feed.htm (which is located at root of web-app)

    <script type="text/javascript" src="https://www.google.com/jsapi?key=ABQIAAAAxII5vpTAk5gatTPIMAFoCxStIDvCAqMV0_KActMytIL1qEezxxQeBqRzIurcFfnrUgG2YMlC07VgbQ"></script>
    <script type="text/javascript">
    
        google.load("feeds", "1", { "callback": OnLoad });
    
        function OnLoad() {
            // Query for president feeds on cnn.com
            var query = 'atlanta bridal shows';
            google.feeds.findFeeds(query, findDone);
        }
    
        function findDone(result) {
            // Make sure we didn't get an error.
            if (!result.error) {
                // Get content div
                var content = document.getElementById('content');
                var html = '';
                var submenu = new Array()
                // Loop through the results and print out the title of the feed and link to
                // the url.
                for (var i = 0; i < result.entries.length; i++) {
                    var entry = result.entries[i];
                    html += '<p><a href="' + entry.url + '">' + entry.title + '</a></p>';
                    submenu[i] = entry.url;
                }
                content.innerHTML = html;
    
                document.getElementById('<%= Hidden1.ClientID %>').value = submenu;
            }
        }
    
        google.setOnLoadCallback(OnLoad);
    </script>
    <div id="content"></div>
    

    Then after in page_load event of .aspx page use System.Net.WebClient class methods to request the feed.htm.

    TestFeed.aspx (which is located at root of web-app)

    Markup:

    <body>
        <form id="form1" runat="server">
        <div>
            <asp:Label ID="Label1" runat="server"></asp:Label>
        </div>
        </form>
    </body>
    

    Code-behind:

    protected void Page_Load(object sender, EventArgs e)
        {
            WebClient client = new WebClient();
            string path = Request.Url.GetLeftPart(UriPartial.Authority) + VirtualPathUtility.ToAbsolute("~/feed.htm");
    
            Stream stream = client.OpenRead(path);
            StreamReader sr = new StreamReader(stream);
            //To view the result
            Label1.Text = sr.ReadToEnd();
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Google reader API to get all available items for any RSS feed.
I'm currently using YouTube's feed API to get information about a YouTube channel's uploaded
I am currently using the google maps' reverse geocoding API to convert long/lat received
I'm currently using this function to get all my contacts from Google Contacts. session_start();
I am currently having difficulty using the Google weather API in JavaScript using Mootools.
I'm currently developing a website and part of it involves using Google Maps. I'd
I have searched the Selenium Webdriver APi docs hosted on google code. Currently using
I'm currently using a Google Stock API to retrieve information from the internet about
I want to provide rss feed under google app engine/python. I've tried to use
I currently using Google Places API for retrieving information for in a mobile application(iOS

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.