Results 1 to 4 of 4

Thread: Running ASP files in Ajax Tabs Content script

  1. #1
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Running ASP files in Ajax Tabs Content script

    1) Script Title: Ajax Tabs Content script

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tent/index.htm

    3) Describe problem:

    I am sure there is an easy explaination for this but I cannot find the answer to it. I am trying to run .asp files inside the list items below. It works if I rename the files to .htm but the asp code does not run accordingly. Can someone please advise me on how I can run .asp files as content within Ajax Tab's?


    <ul id="maintab" class="shadetabs">
    <li class="selected"><a href="representative.asp" rel="ajaxcontentarea">REPRESENTATIVE</a></li>
    <li><a href="customer.asp" rel="ajaxcontentarea">CUSTOMER</a></li>
    <li><a href="freetrial.asp" rel="ajaxcontentarea">FREE TRIAL</a></li>
    </ul>

    <div id="ajaxcontentarea" class="contentstyle">
    </div>

    <script type="text/javascript" language="Javascript">
    //Start Ajax tabs script for UL with id="maintab" Separate multiple ids each with a comma.
    startajaxtabs("maintab")
    </script>

    I found this comment (below) from one of the other members on this site in regards to this but can't quite get the gist of it:

    "You cannot include PHP code in an HTML document (with the extension .html, unless you have the MIME type set as application/x-httpd-php). The AJAX can call any type of web document (such as PHP, ASP, Perl, XML, HTML, etc) as long as the page exists on the server."

    I would appreciate any help you good people can offer.

    Thanks in advance.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    As far as I know, there really is no rule on this. In general, the server should serve the .asp page processing the asp code on it into HTML which the script would then receive from the request object and write to the target division on the 'top' page.

    If the generated HTML of the asp page, once served, is invalid, that will often cause problems*. You can check that by viewing the external .asp file alone in the browser and validating it. If there are errors, these should be able to be fixed by modifying the .asp page.

    However, any given server running any given version of asp might not work out like that even though most will.

    If you also have client side VB or javascript on the external asp page, that may create other problems. Retrieval of includes must be absolute or relative to the top page. Any values retrieved from the server must be up to date at the time they are sought.


    *This is especially true because the browser will need to parse it twice as HTML. Once while writing via the browser's javascript interpreter as the innerHTML property of the target element and a second time as HTML code. This has a tendency to magnify errors and often overcomes a browser's error correcting algorithms.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Apr 2007
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thank you John,

    The problem was the <!--#include... files that were outside of the .asp files. They work like a dream now once I include them in ajax content files.

    Much appreciated.

  4. #4
    Join Date
    May 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi i am a newbie with asp and i am having the same problem with the Ajax tabs content. I was hoping you could explain how you used the <!--#include to solve the problem i.e. where and how you used it. Your help would be really appreciated Thanks James

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •