asp.net验证码刷新
aspx当中加入
<script type="text/javascript">
function refreshimg()
{
document.getElementById(" <% =Image1.ClientID %>").src="getimg.aspx"; //image1为你的验证图片名.getimg.aspx是你产生图生的网页.
}
</script>
<span style="cursor:hand"> <asp:Image ID="Image1" runat="server" Height="16px" ImageUrl="getimg.aspx" Width="34px" /> </span> //span里为改变鼠标为手型.
cs当中
protected void Page_Load(object sender, EventArgs e)
{
Image1.Attributes.Add("onmouseup", "javascript:refreshimg();");
}
<script type="text/javascript">
function refreshimg()
{
document.getElementById(" <% =Image1.ClientID %>").src="getimg.aspx"; //image1为你的验证图片名.getimg.aspx是你产生图生的网页.
}
</script>
<span style="cursor:hand"> <asp:Image ID="Image1" runat="server" Height="16px" ImageUrl="getimg.aspx" Width="34px" /> </span> //span里为改变鼠标为手型.
cs当中
protected void Page_Load(object sender, EventArgs e)
{
Image1.Attributes.Add("onmouseup", "javascript:refreshimg();");
}
加油,哥们,现在开始!