I have integrated an existing Classic ASP site with JQuery (they were using VBScript before). The previous version works fine but the script's needed to be updated so it will work on other browsers. But when I redirect the page with JQuery integrated, the system loads the default.asp file and the second URL. The address bar also shows the default url.
How can I prevent this?
When I use the window.open('url'), it opens the correct page with the correct URL but I have 2 tabs open. When I use window.open('url', '_self') it still redirects to the problematic page.
P.S. Response.Redirect 'url' and window.open('url', '_self') give the same results.
Edit: Here's some of the code used
Here's the main frame JS (submit function) that loads within the default.asp
$("img[name=cmdLog]").click(function(){
            $("form[name=frmLogIn]").target = "_top";
            $("form[name=frmLogIn]").get(0).setAttribute("action", "ValidateUser.asp");
            $("form[name=frmLogIn]").submit();
        });
Here's ValidateUser.asp (without the updated JS, using only VBScript)
<form name="frmValidate" method="post">
    <%
        Session("PMISConnString")="Provider=SQLOLEDB;Server=192.168.x.x;User ID=sa;PWD=x;Database=DB"
        dim conn, rsEmp, SQLQuery, m_Code,i,lenStr,newCode,rsUser
        set conn=Server.CreateObject("ADODB.Connection")
        m_Code=Request.Form("txtEmpID")
        lenStr=len(m_code)
        newCode=""
        for i=1 to lenStr
            if mid(m_Code,i,1)="'" then
                newCode=newCode & "''"
            else
                newCode=newCode & mid(m_Code,i,1)
            end if
        next 
        conn.Open=Session("PMISConnString")
        dim clsCrypt
        dim url
        set clsCrypt=Server.CreateObject("ChiperText.clsChiperText")
        SQLQuery="SELECT UserCode, Pwd "
        SQLQuery=SQLQuery & "FROM Users "
        SQLQuery=SQLQuery & "WHERE UserCode='" & clsCrypt.ChiperText(lcase(newCode)) & "'"
        set rsUser=Server.CreateObject("ADODB.Recordset")
        rsUser.Open SQLQuery,conn
        if rsUser.EOF then
            url = "ErrorPage.asp?TYPE=6"
        elseif rsUser.Fields("Pwd")<>clsCrypt.ChiperText(Request.Form("txtEmpPassword")) then
            url = "ErrorPage.asp?TYPE=7"
        end if
        SQLQuery="SELECT EmpID,EmpFirst,EmpLast,dbo.GetCapitalChars(Employee.EmpMid) AS MidInitial From Employee WHERE EmpID='" & newCode & "' "
        SQLQuery=SQLQuery & "AND EmpActive=1 "
        set rsEmp=Server.CreateObject("ADODB.Recordset")
        rsEmp.Open SQLQuery,conn
        if not rsEmp.EOF then
            Session("EmpID")=Request.Form("txtEmpID") 
            Session("MyName")=rsEmp.Fields("EmpFirst") & " " & rsEmp.Fields("MidInitial") & " " & rsEmp.Fields("EmpLast")
            'varServer="http://" + Request.ServerVariables("SERVER_NAME") + "/" + Session("VirtualName") + "/"
            Response.Cookies("Site")="http://" + Request.ServerVariables("SERVER_NAME") + "/" + "PMIS"
            Session("Server")="http://" + Request.ServerVariables("SERVER_NAME") + "/" + "PMIS"
            Session("ImgFolder")="http://" + Request.ServerVariables("SERVER_NAME") + "/" + "PMIS/Images/" 'full path ng images folder under PMIS directory
            url = "main2.asp"
        else
            url = "ErrorPage.asp?TYPE=1"
        end if
        Response.Redirect(url)
        rsEmp.Close
        Set rsEmp=Nothing
        set clsCrypt=Nothing
        conn.Close
        set conn=Nothing
    %>
</form>
 
    