随笔分类 -  MVC

MVC的学习
摘要:转自http://www.2cto.com/database/201511/449573.html提示未注册,找不到驱动程序No Entity Framework provider found for the ADO.NET provider with invariant name 'System.... 阅读全文
posted @ 2016-01-02 17:28 南潇湘 阅读(414) 评论(0) 推荐(0)
摘要:页面下拉单的应用,ViewData["atypeList"]是List<SelectListItem> <%=Html.DropDownList("dd", (IEnumerable < SelectListItem > )ViewData["atypeList"])%>ListBox的应用//准备数据SelectListItem news = new SelectListItem { Text = "请选择", Value = null };List<SouGeDB.Pl 阅读全文
posted @ 2013-01-14 17:36 南潇湘 阅读(209) 评论(0) 推荐(0)
摘要:System.Drawing.Image img = System.Drawing.Image.FromFile(Commen.CommenFunction.Path + picPath);//找到物理地址 pic.Width = img.Width; pic.Height = img.Height; 阅读全文
posted @ 2012-10-16 11:14 南潇湘 阅读(113) 评论(0) 推荐(0)
摘要:public static string divClass = "<div class='viciao'>"; public static string spanClass = "<span class='disabled'>"; /// <summary> /// 分页 /// </summary> /// <param name="png">当前页码</param> /// <param name="sumNum 阅读全文
posted @ 2012-10-16 11:09 南潇湘 阅读(280) 评论(0) 推荐(0)
摘要://权限的验证public class CheckRoleAttribute : ActionFilterAttribute, IActionFilter { public override void OnActionExecuting(ActionExecutingContext filterContext) { try { SougeUser su = filterContext.HttpContext.Session["SystemUser"] as SougeUser; if (su == null) { filterContext.Result = new Red 阅读全文
posted @ 2012-10-16 10:47 南潇湘 阅读(506) 评论(0) 推荐(0)
摘要://jquery.cookie.jsjQuery.webpages = function(obj) { var text; var list = obj.attributes; try { if (list["type"] != undefined) { var type = list["type"].value; switch (type) { case "login": var msg; var url = w... 阅读全文
posted @ 2012-10-16 10:31 南潇湘 阅读(206) 评论(0) 推荐(0)
摘要:///id要找的父类的id///把找到的子类的id存放到idList中 private void GetAllSonPlateId(Guid id, ref List<Guid> idList) { try { List<Guid> gets = _videoR.GetSonId(id); if (gets.Count > 0) { foreach (Guid item in gets) ... 阅读全文
posted @ 2012-10-15 11:17 南潇湘 阅读(371) 评论(0) 推荐(0)
摘要:1.在静态页面中<script type="text/javascript" language="javascript" src="/Scripts/jquery.cookie.js"></script> <script type="text/javascript" language="javascript"> $(document).ready(function() { var index = 0; while (index < $('div& 阅读全文
posted @ 2012-09-26 11:12 南潇湘 阅读(577) 评论(0) 推荐(0)
摘要:静态页面包括纯静态和伪静态//替换模版中的内容public bool WriteFile(string strText,string strContent,string strAuthor) { string path = HttpContext.Current.Server.MapPath( "/TesConvert/news/ ");//定义html文件存放路径 Encoding code = Encoding.GetEncoding( "gb2312 ");//定义文字编码 // 读取模板文件 string temp = HttpContext.C 阅读全文
posted @ 2012-09-26 11:03 南潇湘 阅读(229) 评论(0) 推荐(0)
摘要:<script type="text/javascript"> function check() { var name = document.getElementById("albumName"); var uName = document.getElementById("userName"); if (name.innerText == "" || uName.innerText == "") { alert("相册名或者用户名不可以为空"); // docum 阅读全文
posted @ 2012-08-25 11:20 南潇湘 阅读(255) 评论(0) 推荐(0)
摘要:让我们看一个简单的表单提交场景,往产品数据库中加一个新产品:上面的页面是在用户访问我们应用的“/Products/Create”URL时返回的,该网页的的HTML表单标识如下:上面的标识是标准的HTML,在<form>元素中,我们有2个<input type="text"/>文本框,然后在表单的下部有一个HTML提交按钮,点击该按钮,会导致包含该按钮的表单将表单输入提交到服务器,该表单会向由它的“action”属性(在这里是“/Products/Save”)表示的URL提交内容。使用先前的“第四个预览版”,我们也许会使用象下面这样的ProductsC 阅读全文
posted @ 2012-08-25 10:57 南潇湘 阅读(1132) 评论(0) 推荐(0)
摘要:int count = 4;//视频用4byte byte[] byteTemp = new byte[count]; int readCn = stream.Read(byteTemp, 0, 4); for (int i = 0; i < readCn; i++) { s += byteTemp[i].ToString(); } if (type == 1) { //flv mpg rmvb wmv avi 3gp 视频的判断 if (s == "00028" || s == "001186" || s == "46827770&qu 阅读全文
posted @ 2012-08-06 09:36 南潇湘 阅读(502) 评论(0) 推荐(0)
摘要:1.在mvc页面中 后台代码中 如果不使用<%=%>中的等号 ,有时候会出错eg:<a href="<%=item.ID %>"> <%=item.Title%></a>当省略Item.ID前的等号的时候,出错:2.在mvc中,要使用链接时,可以使用<a href="<%=item.ID%>">跳转</a> 还可以使用<%=Html.ActionLink("跳转","GoTo",new{id=item.ID})%& 阅读全文
posted @ 2012-08-04 09:16 南潇湘 阅读(198) 评论(0) 推荐(0)