Request的属性和防止图片被盗链
摘要:Request.AppRelativeCurrentExecutionFilePath,获取当前执行请求相对于应用根目录的虚拟路径,以~开头,比如"~/default.ashx"Request.PhysicalApplicationPath,获取当前应用的物理路径,比如:d:\VS2010\website\Request.PhysicalPath,获取当前请求的物理路径,即包括文件名,比如:d:\vs2010\website\default.aspxRequest.RawUrl,获取原始请求的URL、Request.Url获得请求的URL,区别涉及到URL重写的问题Requ
阅读全文
posted @
2013-08-01 15:28
Black Bean
阅读(361)
推荐(0)
Asp.net Eval 截取字符串
摘要:用Eval来显示数据库的段落,但是这个Eval是直接把数据库的文字全部显示出来的,有些时候,很多时候字符串过长,不便于查看,只显示部分字符串,可以用Title属性来显示所有字符串,但是每次都在数据库里头截取有点麻烦,干脆就在服务端来弄算了 ,方法如下:label.Text='<%# Eval("CheckList").ToString().Length>8?Eval("CheckList").ToString().Substring(0,8)+"..":Eval("CheckList") %&g
阅读全文
posted @
2013-03-28 11:54
Black Bean
阅读(651)
推荐(0)
jQuery提交Form
摘要:<form id="result" name="result" action="/HelloStruts2/views/register.action" method="post"> <label>UserName</label> <input type="text" name="userBean.username" value="" id="result_userBean_username"/
阅读全文
posted @
2013-01-03 15:03
Black Bean
阅读(435)
推荐(0)