最近在做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;
获得值$("#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;
相关文章推荐
- 最近遇到一个问题,怎么修改环境网站访问总会报ASP.NET 4.0错
- ASP.NET遇到问题,“对象不能从 DBNull 转换为其他类型”,记录一下~问题已经解决,谢谢大家~
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- 记录:在ASP.NET中使用ActiveX插件时遇到的问题
- Asp.net网站部署时遇到的一些问题
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- Centos 7 中部署ASP.NET Core网站问题记录
- 服务器(WIndows2003)部署asp.net网站生成word文档经常遇到的问题!
- asp.net网站开发过程中遇到的问题
- ASP.NET发布网站遇到的几个问题
- 【转】https,https的本地测试环境搭建,asp.net结合https的代码实现,http网站转换成https网站之后遇到的问题
- 在使用Asp.net制作网站的时候遇到的问题(一)
- 最近我遇到的一些关于asp.net开发中的问题。。
- [项目过程中所遇到的各种问题记录]图表篇——asp.net上不错的图表选择—FunsionCharts
- 最近遇到的琐碎的问题asp.net
- 在使用Asp.net制作网站的时候遇到的问题(二)
- ASP.NET 最近WEB开发遇到的小问题
- 在使用Asp.net制作网站的时候遇到的问题(一)