ASP.net 动态生成验证码的问题
在ajax的page_Load()里面, 假设我调用一个WebMethod获取了验证图片的 byte[] ,接下去该如何做,让一个已经存在的<img id=“code" />元素显示这个验证图片。谢谢!
通常都是放个iframe,然后把动态图片输出到这个iframe页上。
我感觉图片是个单独的资源,webmethod的方法应该是很难做的。
就是不用iframe至少也应该放到一个单独的处理页中,webmethod的输出毕竟是在同一个页中。
你获取的是byte[] 是图啊还是他的验证码啊?如果是图的话可否考虑使用ashx呢
没有分了 蹭个帖子。。。
我初学现在用三层架构,连mysql 就是连不上,谁有三层架构连的mysql的源码?或者给我写个示例(程序只要能连上mysql,就用label显示一个数据就行)我参考参考? 谢谢
邮箱:cafish@live.cn
谢谢!
定义一个回调函数
//生成验证码 再定义一个callback函数:
function callback(result){ //result中存放的是你生成验证码返回值
docment.getElmentById("img1").src = result;
}
//HTML代码中必须写个<img id ="img1"/>
就用img
<img src="生成验证码的url。返回一个image流。">
然后再这个页面checkCode.aspx上动态生成验证码:
C# code:
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Configuration;
using System.Drawing;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
usi
相关问答:
Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.Design
Imports System.Web.UI.WebControls
Namespace CBDAspNet.WebControls.HTML
''' <summary>
'' ......
调整了这里,那里出问题。
有没有什么好的方法,像调整对话框一样????
找个专门做页面的
在dreamweaver里调。。。也可以直接控制HTML代码
确实痛苦 感同身受呀
哈哈 坚决路过。
用DW吧,VS搞设计 ......
C# code:
SqlConnection conn = CsDB.sqlcon();
SqlDataAdapter da = new SqlDataAdapter("select fwCoding from bjmuma_fwCoding where OrderNumber='" + Order + & ......
asp.net批量上传图片最好有源码,在线等!!!!!!!
源码很长的。
参考
C# code:
HttpFileCollection files = HttpContext.Current.Request.Files;
if (files.Count <= 1)
{
......