ASP y ServerXMLHttp URGENTE !!!!!!!!!!!!!!!!!!!!!!!!!!!

22/10/2003 - 15:31 por oscarledesma | Informe spam
Hola gente, tengo un problema al usar el xmlhttp, cuando
envio un archivo xml desde una pag asp hacia el servidor
usando el xmlhttp(el envio del .xml lo hago del lado del
cliente con vbscript usando xmlhttp) la proceso del lado
del servidor y la muestro en una tabla, al terminar de
mostrarla no tengo mas control de los eventos sobre esa
pagina y nose por que, es decir que despues de procesar el
xml al hacer click en algun boton que tiene funcionalidad
esta no responde por que no se genera ningun evento. Por
favor si alguien me puede ayudar por que hace un tiempo
que estoy con eso y no lo puedo solucionar
Este es el codigo:
Client Side:
dim XmlDoc,Archivo,tamano,Path,Pos
set xmlDoc = CreateObject("Msxml2.DOMDocument.4.0")
pos=document.all.item("SlcDrives").selectedIndex
Path=document.all.SlcDrives.Options(pos).value & ":\" &
ArchivoXML
xmldoc.load (Path)

if xmlDoc.parseError.errorCode <> 0 then
if xmlDoc.parseError.errorCode = -2146697211 then
Msgbox "No se encuentra el archivo de
Importacion" & vbcrlf & "en la Ubicacion Especificada"
else
MsgBox "Se ha producido un error" & vbcrlf
& "Consulte al personal de sistemas"
end if
else
set xmlHTTP = CreateObject("Msxml2.ServerXMLHTTP.4.0")
xmlHttp.open "POST", "OBT-FAD.asp", false
xmlHttp.send xmlDoc
document.write xmlHttp.responseText
set xmldoc = nothing
set xmlhttp = nothing
end if

SERVER SIDE

set xmldoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmldoc.async=false
xmldoc.load(request)
dim tam,SQLQuery,RS,contador
contador=0
set tam =xmldoc.getElementsByTagName("nombre")
For j=0 To tam.length -1
Response.Write "<TR>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("codoper").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("nombre").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("fecha").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write "</TD>"
Response.Write "</TR>"
Next
set rs = nothing
 

Leer las respuestas

#1 Jhonny Vargas P.
22/10/2003 - 19:58 | Informe spam
Hola Oscar,

En que línea te marca el error?


Saludos,
Jhonny Vargas P. [MS MVP-ASP]
Santiago de Chile


"oscarledesma" wrote in message
news:0d8801c398a0$c8078070$
Hola gente, tengo un problema al usar el xmlhttp, cuando
envio un archivo xml desde una pag asp hacia el servidor
usando el xmlhttp(el envio del .xml lo hago del lado del
cliente con vbscript usando xmlhttp) la proceso del lado
del servidor y la muestro en una tabla, al terminar de
mostrarla no tengo mas control de los eventos sobre esa
pagina y nose por que, es decir que despues de procesar el
xml al hacer click en algun boton que tiene funcionalidad
esta no responde por que no se genera ningun evento. Por
favor si alguien me puede ayudar por que hace un tiempo
que estoy con eso y no lo puedo solucionar
Este es el codigo:
Client Side:
dim XmlDoc,Archivo,tamano,Path,Pos
set xmlDoc = CreateObject("Msxml2.DOMDocument.4.0")
pos=document.all.item("SlcDrives").selectedIndex
Path=document.all.SlcDrives.Options(pos).value & ":\" &
ArchivoXML
xmldoc.load (Path)

if xmlDoc.parseError.errorCode <> 0 then
if xmlDoc.parseError.errorCode = -2146697211 then
Msgbox "No se encuentra el archivo de
Importacion" & vbcrlf & "en la Ubicacion Especificada"
else
MsgBox "Se ha producido un error" & vbcrlf
& "Consulte al personal de sistemas"
end if
else
set xmlHTTP = CreateObject("Msxml2.ServerXMLHTTP.4.0")
xmlHttp.open "POST", "OBT-FAD.asp", false
xmlHttp.send xmlDoc
document.write xmlHttp.responseText
set xmldoc = nothing
set xmlhttp = nothing
end if

SERVER SIDE

set xmldoc = Server.CreateObject("Msxml2.DOMDocument.4.0")
xmldoc.async=false
xmldoc.load(request)
dim tam,SQLQuery,RS,contador
contador=0
set tam =xmldoc.getElementsByTagName("nombre")
For j=0 To tam.length -1
Response.Write "<TR>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("codoper").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("nombre").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write xmlDoc.getElementsByTagName
("fecha").item(j).text
Response.Write "</TD>"
Response.Write "<TD align=" & """" & "center" & """"
& ">"
Response.Write "</TD>"
Response.Write "</TR>"
Next
set rs = nothing

Preguntas similares