您的位置:首页 > 编程语言 > ASP

最近在做ASP.net网站用到的技术和遇到的问题做个记录

2013-11-07 11:09 465 查看
1.<select id="sel"><option value="value">text</option></select>

获得值$("#sel").val();

2.<input type="radio" id="Radio1" name="radio" value="1" />

<input type="radio" id="Radio2" name="radio" value="2" />

<input type="radio" id="Radio3" name="radio" value="3" />

获得选中radio的值:var v_RdValue=$('input[name="radio"]:checked').val();

3.ASP.NET从服务器下载文件

string filePath=Server.MapPath("文件名");

System.IO.FileInfo fileInfo = new System.IO.FileInfo(filePath);

Response.Clear();

Response.ClearContent();

Response.ClearHeaders();

Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);

Response.AddHeader("Content-Length", fileInfo.Length.ToString());

Response.AddHeader("Content-Transfer-Encoding", "binary");

Response.ContentType = "application/octet-stream";

Response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312");

Response.WriteFile(fileInfo.FullName);

Response.Flush();

Response.End();

4.移除指定DIV子元素的属性

移除divTEST中子元素<a>的class属性

$("#divTEST a[class=curr]").removeClass("curr");

添加class属性

$("#id").attr("class","curr");

5.读取客户端文件思路

A.把客户端文件上传到服务器临时文件夹,返回服务器文件完整路径或相对路径

B.操作服务器文件

用到的技术利用FileUpLoad服务器控件,FileUpLoad.SaveAs("服务器文件完整路径");

6.OLEDB读EXCEL

7.ajax调webservice

//ajax调webservice

$.ajax({

async:true,

type: "post",

contentType: "application/json",

url:'WEBSERVICE/TYWebService.asmx/HelloWorld',

data: "{msg:'HelloWorld'}", //参数要对应

dataType:"json",

success: function(result) {

//

}

});

[WebMethod]

public string HelloWorld(string msg) {

return msg;

}

8.Cookie Manager

9.Session Manager

10.支付宝接口

11.图片压缩

12.发送邮件

13.查看Oracle版本

sql:select * from v$version;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐