随笔分类 - [07]Ajax
摘要:1.引用jQuery及ajaxfileupload.js 2.js 3.html <input type="file" id="file1" onchange="ajaxFileUpload()" name="file" class="imgup" accept="image/*"/> 4.uplo
阅读全文
摘要:IE10下调试会报javascript错误:Sys.WebForms.PageRequestManagerServerErrorExceptionScriptManager控件之后添加
阅读全文
摘要:ScriptManager.RegisterStartupScript(this.UpdatePanel1, this.GetType(), "updateScript", "alert('投票成功!')", true);
阅读全文
摘要:一.添加Newtonsoft.dll引用二.cs部分 Response.Cache.SetCacheability(HttpCacheability.NoCache); if (Request.QueryString["select"]!=null) ...
阅读全文
摘要:1.页面部分 用户名:2.编写javascript脚本部分3.ashx中代码 public void ProcessRequest(HttpContext context) { context.Response.ContentType ...
阅读全文
摘要:1.将svc中的方法直接在页面javascript中调用,非常方便实用2.使用方法:1)添加一个svc文件2)添加一个普通的C#方法,其中[OperationContract]表示可在页面脚本中调用,不添加无效 [OperationContract] public Person GetPerson(int id) { return new Person() { Name="tom",Age=20}; }5)添加ScriptManager控件,并在其services集合中添加要调用的svc<asp:ScriptManager runat="server&quo
阅读全文
摘要:1.Json将复杂对象序列化为一个字符串,在浏览器端再将字符串反序列化为Javascript可读取的对象2.使用方法:JavaScriptSerializer().Serialize(p); JavaScriptSerializer jss = new JavaScriptSerializer();...
阅读全文
摘要:1.读取数据的一般处理程序页面GetAdmin.ashx List<Admin> admins = AdminManager.getAdminall(); StringBuilder sb = new StringBuilder(); foreach (Admin ad in admins) { sb.Append(ad.Id).Append("|").Append(ad.Name).Append("$"); } context.Re...
阅读全文
摘要:1.准备一般处理程序ashx,当请求时返回当前服务器时间 public void ProcessRequest (HttpContext context) { context.Response.ContentType = "text/plain"; context.Response.Write(DateTime.Now.ToString()); }2.编写javascript脚本,当然ActiveXObject(“Micsrosoft.XMLTTP”)只能支持IE <script type="text/javascript" language=&q
阅读全文
摘要:1.引入ScriptManager2.相应代码 3.代码中绑定数据
阅读全文
浙公网安备 33010602011771号