javascript - Classic ASP and JQuery reloads default.asp page on redirect -
i have integrated existing classic asp site jquery (they using vbscript before). previous version works fine script's needed updated work on other browsers. when redirect page jquery integrated, system loads default.asp file , second url. address bar shows default url.
how can prevent this?
when use window.open('url')
, opens correct page correct url have 2 tabs open. when use window.open('url', '_self')
still redirects problematic page.
p.s. response.redirect 'url'
, window.open('url', '_self')
give same results.
edit: here's of code used
here's main frame js (submit function) loads within 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 updated js, using 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="" i=1 lenstr if mid(m_code,i,1)="'" 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 url = "errorpage.asp?type=6" elseif rsuser.fields("pwd")<>clscrypt.chipertext(request.form("txtemppassword")) url = "errorpage.asp?type=7" end if sqlquery="select empid,empfirst,emplast,dbo.getcapitalchars(employee.empmid) midinitial employee empid='" & newcode & "' " sqlquery=sqlquery & "and empactive=1 " set rsemp=server.createobject("adodb.recordset") rsemp.open sqlquery,conn if not rsemp.eof 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>
if in frameset, consider using javascript change window.top.location.href redirect url instead.
Comments
Post a Comment