06 2012 档案

摘要:1._开头的cshtml文档将不能在服务器上访问,类似Global.asax等文件2.服务端代码必须在@{}之间,要输出@符号可以用@Html.Encode("@")或者@@转义 ()用来显示支持代码表达式,如:@{ ViewBag.Title = "Sample"; string AppName = "MyApp";}<h2>@AppName.Model</h2>目的是想输出<h2>MyApp.Model<h2>,这里引擎无法正确识别.的意义,要能够达到预期效果,需要将AppName用 阅读全文
posted @ 2012-06-30 19:18 Bug山Bug海 阅读(664) 评论(0) 推荐(0)
摘要:1.border-collapse:设置表格边框是否合并默认样式:testtesttesttesttesttest设置collapse后样式:testtesttesttesttesttest2.!important:提高指定样式规则的应用优先权,IE6不完全支持写在定义的最后面,例如:.box{color:red !important;}3.>子元素选择器:只作用于某元素子元素例:h1 > strong {color:red;} 只作用于h1的直接子元素 h1 strong 后代原则器,作用于所有h1的子元素,无限级联4.属性选择器[]:可以为拥有指定属性的 HTML 元素设置样式 阅读全文
posted @ 2012-06-28 03:02 Bug山Bug海 阅读(184) 评论(0) 推荐(0)
摘要:当标签高度大于字体高度时,文字会偏高,可以设置css的height和line-height大小相同,此方法只适合单行居中 阅读全文
posted @ 2012-06-28 01:45 Bug山Bug海 阅读(1911) 评论(0) 推荐(0)
摘要:有时候页面中的中文打开后变成乱码,主要是编码问题在DOCTYPE标签后加入<meta http-equiv="content-type" content="text/html; charset=utf-8" />charset对应页面的编码,不一定是utf-8,也可能是gb2312,gbk等,根据实际情况修改HTML header结构<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/htm 阅读全文
posted @ 2012-06-27 21:05 Bug山Bug海 阅读(2186) 评论(0) 推荐(0)
摘要:#region Types public enum Countries { USA, Italy, } public class Customer { public string Name {get;set;} public string City { get; set; } public Countries Country { get; set; } public Order[] Orders { get; set; } public override st... 阅读全文
posted @ 2012-06-27 00:28 Bug山Bug海 阅读(176) 评论(0) 推荐(0)
摘要:public class Category { public int IdCategory { get; set; } public string Name { get; set; } } public class Product { public string IdProduct { get; set; } public int IdCategory { get; set; } public string Description { get; set; } } class Pro... 阅读全文
posted @ 2012-06-26 20:34 Bug山Bug海 阅读(182) 评论(0) 推荐(0)
摘要:function Person(properties) { for (var item in properties) { //必须放在匿名函数内分离作用域,不然每个p会是最后一项item的值 (function (which) { //记住这个作用域内的值 var p = item; which["Get" + p] = function () { return properties[p]; }; which["Set" + p] = ... 阅读全文
posted @ 2012-06-25 22:53 Bug山Bug海 阅读(137) 评论(0) 推荐(0)