Wrox Programmer Forums
|
ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 14th, 2003, 04:15 AM
Authorized User
 
Join Date: Nov 2003
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP Refresh Problem...

I have the following code...
<%
    Response.Expires = -1000
    Dim x1
    set x1 = Server.CreateObject("MSXML.DOMDocument")
    x1.loadXML("<P><T a='1' n='ttt'/><T a='2' n='yyy'/></P>")
    dim xmlTempNode
    set xmlTempNode = x1.selectSingleNode("//T[@a='4']")
    if (xmlTempNode is Nothing) then
        Response.Write "Does not exists..."
    else
        Response.Write "Exists"
        Response.Write " value is:"
        Response.Write xmlTempNode.attributes.getNamedItem("n").text
   end if
    set xmlTempNode = nothing
    set x1 = nothing
%>

This code seems to be ok, when I execute it for the first time.
If I change,
    set xmlTempNode = x1.selectSingleNode("//T[@a='4']")
to
    set xmlTempNode = x1.selectSingleNode("//T[@a='2']")
There is no effect in the code.
But then if I modify the XML (say by modifying an attribute value)
it shows the result correctly.

Thanks,
Babloo

 
Old November 14th, 2003, 08:15 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,212
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi Babloo,

this has always worked for me:
Code:
Response.CacheControl = "no-cache"
Response.AddHeader "Pragma", "no-cache"
Response.Expires = -1
BTW in your XPath, using // is a bad habit to get into because it can be a very expensive operation (not in XML as small as your example here, though). Its much better to use the full path if you know it, e.g. /P/T[@a='4']

rgds
Phil





Similar Threads
Thread Thread Starter Forum Replies Last Post
auto-refresh page with asp? nlicata Classic ASP Basics 4 October 6th, 2015 01:52 PM
In Asp using Javascript how to refresh ComboListbo d_khandhar Classic ASP Components 1 June 8th, 2006 01:20 PM
ASP Refresh problem MDrumm BOOK: Beginning ASP 3.0 2 May 25th, 2005 11:01 AM
Refresh Problem gkirk Beginning PHP 2 February 25th, 2005 04:14 PM
Refresh problem with ASP.NET on Linux jacob ASP.NET 1.0 and 1.1 Professional 1 January 23rd, 2005 03:10 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.