473,396 Members | 1,764 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I cannnot dynamically load .aspx page w/ AJAX

daJunkCollector
I am using AJAX to dynamically load content into a <div> layer. As it stands, I am loading .html's into the <div> layer and it works awesome. The problem is that when I try to replace the .html with .aspx the content fails to load and I receive an error. It is very possible that the method I am currently using will not work as I desire. Perhaps someone can point me in the right direction please.

SO...the following code is stored in an external .js file:

Expand|Select|Wrap|Line Numbers
  1. //** Heres some AJAX homeboy **\\
  2.  
  3. //Hightlights the active tab on the main navigation
  4. function activeTab(x)
  5.                 {   
  6.                         for (var i=1; i<=9; i++)
  7.                         {
  8.                             document.getElementById("tab"+x+"_"+i).style.background="#FFFF33";
  9.                              document.getElementById("tab"+x+"_"+i).style.color="#34455F";
  10.                          }      
  11.                 }
  12.  
  13.  
  14. function ajaxManager()
  15.     {
  16.     var args = ajaxManager.arguments;
  17.     switch (args[0])
  18.         {
  19.         case "load_page":
  20.         if (document.getElementById) {
  21.             var x = (window.ActiveXObject) ? new ActiveXObject("Microsoft.XMLHTTP") : new XMLHttpRequest();
  22.             }
  23.             if (x)
  24.                 {
  25.             x.onreadystatechange = function()
  26.                     {
  27.                 if (x.readyState == 4 && x.status == 200)
  28.                         {
  29.                         el = document.getElementById(args[2]);
  30.                         el.innerHTML = x.responseText;
  31.                     }
  32.                     }
  33.                 x.open("GET", args[1], true);
  34.                 x.send(null);
  35.                 }
  36.             break;
  37.         case "loadNav":
  38.             ajaxManager('load_page', 'itNav.html', 'loadedNav');
  39.             break;
  40.  
  41.         case "firstPage":
  42.             ajaxManager('load_page', 'it1.aspx', 'loadedMain');
  43.             break;
  44.  
  45.         case "secondPage":
  46.             ajaxManager('load_page', 'it2.html', 'loadedMain');
  47.             break;
  48.  
  49.         case "thirdPage":
  50.             ajaxManager('load_page', 'it3.html', 'loadedMain');
  51.             break;
  52.  
  53.         case "fourthPage":
  54.             ajaxManager('load_page', 'it4.html', 'loadedMain');
  55.             break;
  56.         }
  57.     }

I then provide links in the left navigation that call the javascript functions as follows:

[HTML]<a href ="javascript:void(0)" onclick="ajaxManager('firstPage')">Sub Navigation1</a>[/HTML]

This all works fine and dandy for the Cases where the 'it2.HTML', 'it3.HTML', and 'it4.HTML' are loaded into <div id="loadedMain"></div>, but the .aspx page in Case "firstPage" does not work.

Please let me know if anything is unclear. I will check this post frequently until the issue is resolved.

Thank you.
Oct 5 '07 #1
4 2121
Ok AJAXers, I found a lead regarding this issue, but it remains unresolved.

This post helps to clarify the javascript error I receive when I run my page:

http://forums.asp.net/t/1160491.aspx

The final post on the forum by Shigun gives me hope and inspiration, but I am not quite sure how to apply his logic. If anyone can provide some detailed insight I would be forever faithful!
Oct 5 '07 #2
acoder
16,027 Expert Mod 8TB
It maybe a typo here, but on line 42, you forgot a closing single quote.
Oct 5 '07 #3
Acoder,

Hah thanks, but unfortunately that single quote is present in my actual script.
Oct 5 '07 #4
pbmods
5,821 Expert 4TB
Just because I love dumb questions...

There were actually two missing quotes (lines 38 and 42). Did you get both of them?
Oct 5 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am have facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the...
1
by: Kamal Jeet Singh | last post by:
Hi Friends !! I am facing problem in controlling the dynamically created controls on web page. The problem Scenario is Scenario:- My requirement is to load the web user controls on the web...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
1
by: Reza Nabi | last post by:
Bakground: I have a webform (LoadCtl.aspx) which loads the user control to a placeholder dynamically based on the ctlName querystring passed in the URL. Webform (LoadCtl.aspx) also passes a...
2
by: Vivek Sharma | last post by:
Hi There, I have a situation where I wish to load the controls dynamically on the basis of user role. Hence, I am using this code. if (UserRole == "IS Administrator") { Control UC1 =...
4
by: Rob Meade | last post by:
Hi all, I played with my first bit of AJAX the other week and was pleasantly surprised that I achieved my goal..now I'd like to try something else.. Question... If I have an updatePanel,...
7
by: Nathan Sokalski | last post by:
I have a page which I dynamically add several usercontrols (*.ascx files) to using the following code: Public Sub Refresh() For Each section As DataRow In Me.GetSections().Rows...
4
by: ameshkin | last post by:
Hi Everybody, I'm just now learning javascript and I'm using mootools. What I want to do is to dynamically load a php page into accordian panel 2, depending on which radio button is selected in...
7
by: RichB | last post by:
I am trying to get to grips with the asp.net ajaxcontrol toolkit, and am trying to add a tabbed control to the page. I have no problems within the aspx file, and can dynamically manipulate a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.