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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:05:55+00:00 2026-06-10T22:05:55+00:00

I would like it so when a link is clicked on the homepage it

  • 0

I would like it so when a link is clicked on the homepage it would load a particular xml file into the next page (the page is called category-list.apsx).

This category list page uses the Repeater Control method to display the xml details on the page. I used the example shown here:

http://www.w3schools.com/aspnet/aspnet_repeater.asp

So at the moment the repeater script looks like:

<script runat="server">
    sub Page_Load
    if Not Page.IsPostBack then
       dim mycategories=New DataSet
       mycategories.ReadXml(MapPath("categories.xml"))
       categories.DataSource=mycategories
       categories.DataBind()
    end if
    end sub
</script>

After doing some research I did find someone with the same problem and the solution was to insert #tags as part of the link on the homepage (i.e. category-list.apsx#company1results) and then some script on the list page to pick up the correct xml file:

<script type="text/javascript">
    var old_onload = window.onload; // Play it safe by respecting onload handlers set by other scripts.
    window.onload=function()
    {
     var categories = document.location.href.substring(document.location.href.indexOf("#")+1);
     loadXMLDoc('XML/'+categories+'.xml');
     old_onload();
    }
</script>

This was from the following link:

http://www.hotscripts.com/forums/javascript/45641-solved-specify-xml-file-load-when-click-link.html

How can I get these two scripts to connect with each other?

  • 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-10T22:05:57+00:00Added an answer on June 10, 2026 at 10:05 pm

    It’s easier to use a querystring instead of a hash ‘#’, because the querystring will be send server-side, so there is no need of client-side javascript.

    So when you call category-list.apsx?cat=company1results, you can use the following code to switch between xml files:

    Public Sub Page_Load()
        If Not Page.IsPostBack Then
            Dim cat As String = Request.QueryString("cat")
    
            Dim mycategories As DataSet = New DataSet()
            mycategories.ReadXml(MapPath(cat + ".xml"))
            categories.DataSource = mycategories
            categories.DataBind()
        End If
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a href link and I would like it to be clicked when
I would like to construct an HTML link element referencing a CSS file and
I would like to insert a link into the Google Maps InfoWindow to show
I would like a jQuery function to know which link was clicked to call
I would like to have a link in a web page in such a
I would like to show blog details when a link is clicked. Here is
so this is my problem : I would like to handle a clicked link
I would like to resize the targeted window after my hyper link is clicked
I would like to link to a specific section of a report from another
I've recently started developing a portfolio website which I would like to link to

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.