- 博客(37)
- 收藏
- 关注
转载 How to use HTML-5 data-* attributes in ASP.NET MVC
// 1: pass dictionary instead of anonymous object Html.ActionLink( "back", "Search", new { keyword = Model.Keyword, page = Model.currPage - 1}, new Dictionarystring,Object> { {"class","prev"}
2013-04-24 00:48:44
635
转载 windows 8 免下载安装.NET Framework 3.5
這些訊息可能會因為下列因素而顯示:您的電腦未連線至網際網路。 請連接,然後重試該作業。如果無法連接到網際網路,您可以使用部署映像服務與管理 (DISM) 命令列工具並指定您安裝 Windows 8 所用的安裝媒體 (ISO 映像或 DVD),來啟用 .NET Framework 3.5。在 Windows 8 或 Windows Server 2012 中,
2013-04-18 10:55:53
834
转载 Add @Html.TextBox value from ViewBag
1)@{ ViewBag.Title = "Index";}@Html.TextBox("txtTitle", (string)ViewBag.Title)2)@Html.TextBox("txtName",ViewBag.Parameters.Name)
2012-02-09 22:10:27
2198
原创 CSS 半透明
-ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=30)"; /*IE8*/filter:alpha(opacity=30); /*IE5、IE5.5、IE6、IE7*/opacity: .3; /*Opera9.0+、Firefox1.5+、Safari、Chrome*/要想框内文字不继承透明,设置文字的po
2012-01-18 23:59:58
550
转载 .net 分页
int Step = 5;//偏移量 int LeftNum = 0;//做界限 int RightNum = 0;//右界限 string PageUrl = Request.FilePath; int PageCount = (int)Math.Ceiling((double)(ToatalCountRecord) / P
2011-12-14 17:52:52
410
转载 jQuery中添加自定义或函数方法
方法一: jQuery.fn.setApDiv=function () { //apDiv浮动层显示位置居中控制 var wheight=$(window).height(); var wwidth=$(window).width(); var apHeight=wheight-$("#apDiv").height()
2011-12-05 17:38:35
768
转载 js、jquery实用小技巧集合
Tip15:Jquery触发回车事件 $(function () { $('#target').bind('keyup', function (event) { if (event.keyCode == 13) { alert("Hello~"); }
2011-11-01 02:41:19
570
转载 ExecuteReader的用法
1、MSDN上说:Sends the CommandText to the Connection and builds a SqlDataReader. (这句话就不翻译了)2、实例片段: [C#]public void Crea
2011-10-18 12:58:45
18367
2
转载 Asp.net实现文章内关键词替换
现在很多网站都有文章内关键词替换功能,比如:.Net中的Asp.net替换成.Net中的Asp.net本文就是教你如何实现该功能,以及实现该功能所遇到的难题,以及如何解决.继续本文开头的例子,你可以看到,如果只是替换asp.net这个关键词,用.net是很容易
2011-09-29 01:44:59
708
转载 SQL语句在表中新增字段(列)
ALTER TABLE — 更改表属性语法ALTER TABLE table [ * ] ADD [ COLUMN ] column typeALTER TABLE table [ * ] ALTER [ COLUMN ] column
2011-09-27 11:05:55
11137
转载 .net 后台操作Cookies
下面是写cookie:HttpCookie cookie = new HttpCookie("Info");//定义cookie对象以及名为Info的项DateTime dt = DateTime.Now;//定义时间对象 TimeSpan ts=new Tim
2011-09-22 23:58:59
1053
转载 Asp.net Mvc Enum 扩展
一直以来都觉得enum、struct以及class是编程的基础结构。我们通常意图用枚举来表示一些名称的值属性。有的时候用Enum来填充DropDownList也算是不错的选择。假设我们有一个enum:public enum Role{User = 0,Ad
2011-09-20 17:31:21
1262
原创 mvc 循环输出list中值到RadioButton
在html helper看不到RadioButtonList,所以用另一种方法输出list中的值: list = new List(); list.Add(new SelectListItem{Text="男",Value="male",Selected=t
2011-09-19 16:23:00
1626
转载 js中replace的用法
replace方法的语法是:stringObj.replace(rgExp, replaceText) 其中stringObj是字符串(string),reExp可以是正则表达式对象(RegExp)也可以是字符串(string),replaceText是替代查找到的字符串。。为了
2011-08-28 12:53:38
454
原创 .net JSON序列化数据
string content = string.Empty;JavaScriptSerializer json = new JavaScriptSerializer();foreach (var row in table){ person p =
2011-08-08 16:24:19
541
转载 MySQL与分页
使用查询语句的时候,经常要返回前几条或者中间某几行数据,这个时候怎么办呢?不用担心,mysql已 经为我们提供了这样一个功能。SELECT* FROMtable LIMIT[offset,] rows| rows OFFSET offset
2011-08-08 12:10:53
388
原创 ckeditor 3.3.1配置
一.ckeditor 3.3.1精简 1、删除_samples和_source文件夹,分别为示例文件和未压缩源程序 2、删除lang文件夹下除zh-cn.js,en.js下的所有语言文件.根据需要删除 3、删除根目录下的changes.html(更新列表),install.html(安装指向),license.html(使用许可). 4、删除skins目录下不需要的皮肤.我一般
2011-06-20 16:49:00
806
原创 asp.net ListView笔记
单向绑定(读取数据) 双向绑定(读、写数据) ListView中ItemUpdating事件找控件:DropDownList ddlLinkType = (DropDownList)ListView1.Items[e.ItemIndex].FindControl ("DropDownList"); ListView中ItemDataBound、ItemInse
2011-06-14 22:57:00
4888
原创 JavaScript成生GUID
function S4() { return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); }function NewGuid() { return (S4() + S4() + "-" + S4() + "-"
2011-06-14 21:15:00
456
原创 JavaScript格式化当前时间为yyyy-mm-dd形式
function getNowFormatDate() { var day = new Date(); var Year = 0; var Month = 0; var Day = 0; var CurrentDate = "
2011-06-14 21:14:00
677
转载 ListView bug解决方法
public static Control FindControl(string controlId, ControlCollection controls) { foreach (Control control in controls) { if (control.ID =
2011-06-13 23:51:00
464
转载 asp.net中ListView的一个Bug
作者:杨中科今天一个学生问了一个问题,他的程序监听ListView的ItemCreated事件,然后在事件响应函数中用FindControl定位InsertTemplate中的控件,然后使用控件的ClientID进行JavaScript的注册:if (e.Item.ItemType == ListViewItemType.InsertItem) { TextBox Te
2011-06-13 22:38:00
5081
原创 JQuery 正则表达式
调用:var checkNum = /^[A-Za-z0-9]+$/;checkNum.test($(this).val()); 1.非负整数 /^/d+$/ 2.正整数 /^[0-9]*[1-9][0-9]*$/ 3.非正整数 /^((-/d+)|(0+))$/ 4.负整数
2011-06-13 14:05:00
69624
1
转载 ASP.NET 中级
/表示网站根目录, ../表示上级目录, ./表示当前目录, ~/表示当前目录(推荐,但只能用在服务器端控件).静态的要用VirtualPathUtility.ToAbsolute("~/a/b1.aspx")将路径转换为当前目录的虚拟路径. 防盗链是用:context.Request.UrlReferrer来做的.context.Response.Flush()强制将服务器的
2011-06-13 14:04:00
664
转载 c# 正则表达式
调用:Regex.IsMatch(email, @"^/w+([-+.]/w+)*@/w+([-.]/w+)*/./w+([-.]/w+)*$"); 只能输入数字:"^[0-9]*$"。 只能输入n位的数字:"^/d{n}$"。 只能输入至少n位的数字:"^/d{n,}$"。 只能输入m~n位的数字:。"^/d{m,n}$" 只
2011-06-13 14:03:00
436
转载 ASP.NET MD5加密
.net 下有加密类可用,可实现md5,sha1加密,添加引用 system.web.security即可用formsauthentication.hashpasswordforstoringinconfigfile( "需要加密的字符串 ", "shal|md5 ")
2011-06-13 14:02:00
309
原创 ASP.NET基础
元素的ID值是给DOM用的,NAME值是给服务器用的. 获取文件在服务器的路径:string fullPath = context.Server.MapPath("Hello2.htm"); 读取文件内容:string content = System.IO.File.ReadAllText(fullPath); 判断字符串是否为空或空值:string.Is
2011-06-13 14:00:00
348
转载 关于网站的优化
图片服务器和主站域名不一样,降低Cookie流量的传输.如果要服务器向浏览器推送数据,则需要使用ServerPush等额外的技术.Http是"请求-响应"的工作方式,因此页面会不断刷新,如果不希望页面刷新则要使用AJAX等技术.断点续传的原理:多线程下载基于断点续传.超链接因为没有向服务器提交ViewState等隐藏字段,所以处理时postback是false,而submit则
2011-06-13 14:00:00
328
原创 JQuery 用法 函数 选择器
$(document).ready(function(){ });等价于:$(function(){ }); 多条件选择器:(注意空格,不能多,不能少)$("p,div,span.menuitem"),同时选择p标签、div标签和拥有menuitem样式的span标签元素 层次选择器:(1)$("div li")获取div下的所有li元素(后代,子、子的子...
2011-06-13 13:59:00
675
原创 DOM 基础
window.event clientX,clientY 获取鼠标在浏览器中的位置 对象在页面居中:document.documentElement.clientWidth /2 - 对象宽度/2document.documentElement.clientHeight /2 - 对象宽度/2 div透明背景:.div1{ background-co
2011-06-13 13:57:00
458
转载 SQL 占位符
cmd.CommandText = "select * from LogIn where username = @username and password = @password";cmd.Parameters.Add(new SqlParameter("username", userName));cmd.Parameters.Add(new SqlParameter("password
2011-06-13 13:51:00
3862
转载 SQL案例
数据升序,降序:select * from Person1where age >20 order by Number asc ,age asc; 数据分组(group by):select nickname,COUNT(*) from Person1 group by NickName; 取出分组中总数大于1的字段的数量:select age,count(*)
2011-06-13 13:49:00
663
原创 DIV内容上下左右居中实例
xmlns="http://www.w3.org/1999/xhtml"> http-equiv="Content-Type" content="text/html; charset=gb2312" /> CSS div的完整居中实例 type="text/css">
2011-06-11 14:48:00
2483
原创 新闻内容入库前过滤
string newsContent = content.Text.Replace("&", "&");newsContent = newsContent.Replace("newsContent = newsContent.Replace(">", ">");newsContent = newsContent.Replace("/"", """);ne
2011-06-11 14:46:00
477
原创 扩展性比较好的圆角边框
/*圆角边框*/.box { width: 1000px; margin:0px auto; } .r1 { height: 1px; overflow: hidden; margin: 0 5
2011-06-11 14:44:00
493
原创 DIV两列并排的标准写法——理解CSS中的float
今天在一个项目中用到了两个DIV左右对齐,我用的是左边的:float:left,右边的float:right,如下:#col1 {background:#eeffee none repeat scroll 0% 0%;float:left;width:25%;height:50px;}#col2{background:#eeeeff none repea
2011-06-11 14:43:00
3829
转载 C#委托
什么是委托 首先要知道什么是委托,用最通俗易懂的话来讲,你就可以把委托看成是用来执行方法(函数)的一个东西。如何使用委托 在使用委托的时候,你可以像对待一个类一样对待它。即先声明,再实例化。只是有点不同,类在实例化之后叫对象或实例,但委托在实例化后仍叫委托。声明,如:1 namespace Vczx.ProCSharp.Exc2 {3 delega
2011-06-11 14:35:00
450
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人