跳转到登陆页的时候验证码页面不刷新是怎么回事?
<div class="lib">
<span class="lib_l">验证码:</span><span class="lib_r"><asp:TextBox ID="verifyCode_txt"
runat="server" Width="90px" CssClass="r_text r_text3" runat="server" MaxLength="4"></asp:TextBox><a
href="#"><img id="imgVerify" alt="看不清?点击更换" onclick="this.src=this.src+'?'" src="VerifyCode.aspx?"
style="vertical-align: bottom; width: 80px; height: 20px; border: 1px solid #ccc;" /></a></span></div>
当我Response.Write("<script>window.parent.location.href='LoginNew2.aspx'</script>");
后我断点到VerifyCode.aspx.cs是没有访问到的,请问下这是怎么回事??
网上说的加上一些随机参数,我都试过了都没有效果!!!!求解啊
------解决方案--------------------一般都是IE缓存引起的
方案一:对页面进行不缓存处理
protected void Page_Load(object sender, EventArgs e)
{
Response.Expires = 0;
Response.CacheControl = "no-cache";
}
方案二:<img标签用js输出
<script type="text/javascript" language="JavaScript">
var numkey = Math.random();
numkey = Math.round(numkey*10000);
document.write("<img src=\"VerifyCode.aspx?k="+ numkey +"\" onClick=\"this.src+=Math.random()\" alt=\"图片看不清?点击重新得到验证码\" style=\"cursor:pointer;\" />");
</script>