asp中用ajax无法及时更新数据???
问个问题哈
我修改了个人密码,想即使查看哈,用了ajax,但是数据在数据库都已经更新了,但是每次显示的都是之前的数据,请问是怎么回事呢?
请求也面的代码:
<!--#include file= "contodb.asp "-->
<%
userid=request( "userid ")
set rs=con.execute( "select * from users where 身份证号= ' "&userid& " ' ")
response.Charset= "gb2312 "
response.Write( "姓 名: "&rs( "姓名 ")&vbcrlf& "身份证: "&userid&vbcrlf& "密 码: "& rs( "密码 "))
%>
每次得到的都是之前未修改的数据,但是数据库中的之已经修改了,怎么回事呢?
------解决方案-------------------- <!--#include file= "contodb.asp "-->
<%
response.expires=0
response.absoluteExpires=now-1
response.cachecontrol= "no-cache "
response.addHeader( "pragma ", "no-cache ")
userid=request( "userid ")
set rs=con.execute( "select * from users where 身份证号= ' "&userid& " ' ")
response.Charset= "gb2312 "
response.Write( "姓 名: "&rs( "姓名 ")&vbcrlf& "身份证: "&userid&vbcrlf& "密 码: "& rs( "密码 "))
%>