ASP include file after ajax post

95 views Asked by At

I have index.asp where i include all files So i have file search.asp where are no includes but function works localy from included files from index.asp

So when i make ajax POST from search.asp to search.asp all included files not working after i put response to the same page.

Also if i include needed file directly to search.asp i got error that dimmed names are redifined.

So only one way as i thought is to dinamicaly include needed file if where are post request like:

<%
  If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
%>
<!--#include virtual="Functions/main.asp"-->
<!--#include virtual="Functions/setlcnid.asp" -->
<%
  End If
%>

but this should not works as it always includes thoose files

So how to include needed files after ajax POST?

1

There are 1 answers

0
Fabio Pellerito On

The includes are excluded from the if condition. I suggest you put the if directly into the files and main.asp setlcnid.asp and they always include