上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 先去下载 mvcpagehttp://mvcpager.codeplex.com/releases/view/64098只需要一个MvcPager.dll文件即可 然后引用MvcPager.dll如需了解更多 可以访问http://www.webdiyer.com/Controls/MvcPager/DownloadsModels 引入命名空间new { ID =ViewBag.ID } 这里放分页前的地址栏查询参数,没有可以不写@using Webdiyer.WebControls.Mvc@using MVC.Models@using System.Data @Html.Pager(Mode 阅读全文
posted @ 2013-07-19 16:56 放哨De老鼠 阅读(583) 评论(0) 推荐(0) 编辑
摘要: 先去下载:http://code.google.com/p/kindeditor/downloads/list引用:LitJSON.dll文件@ViewBag.content 编辑的时候使用 @ViewBag.content//红色区域是后台获取name为TextArea1的值,如果不写 是获取不到的 阅读全文
posted @ 2013-07-19 16:45 放哨De老鼠 阅读(285) 评论(0) 推荐(0) 编辑
摘要: public static string ReplaceHtmlTag(string html, int length = 0){ string strText = System.Text.RegularExpressions.Regex.Replace(html, "]+>", ""); strText = System.Text.RegularExpressions.Regex.Replace(strText, "&[^;]+;", ""); if (length > 0 && 阅读全文
posted @ 2013-07-18 16:53 放哨De老鼠 阅读(228) 评论(0) 推荐(0) 编辑
摘要: 1、JavaScript 方法: 2、jQuery 方法: 阅读全文
posted @ 2013-07-15 10:46 放哨De老鼠 阅读(198) 评论(0) 推荐(0) 编辑
摘要: var msg=0;Validater('abc');function Validater(Name) {var itemId = 1;$.ajax({url: 'adminmenu/ValidaterMenuName/',type: 'POST',cache: false,data: { Name: encodeURIComponent(Name),ID:itemId },dataType: 'text',async: false,timeout: 1000,error: function () { alert('Err 阅读全文
posted @ 2013-07-12 09:28 放哨De老鼠 阅读(560) 评论(0) 推荐(0) 编辑
摘要: 遇到这个错误 在查询时 加上asNoTracking() 即可 阅读全文
posted @ 2013-07-11 14:11 放哨De老鼠 阅读(501) 评论(0) 推荐(0) 编辑
摘要: 配置ckfinder for asp.net 版本下载地址 http://cksource.com/ckfinder/downloadckeditor下载地址http://ckeditor.com/downloadconfig.ascxpublic override bool CheckAuthentication(){ return true; 设置为true} ckeditor config.js 新增config.filebrowserBrowseUrl = '/ckfinder/ckfinder.html'; //不要写成"~/ckfinder/...&quo 阅读全文
posted @ 2013-07-05 15:57 放哨De老鼠 阅读(1832) 评论(0) 推荐(0) 编辑
摘要: 新增new { enctype = "multipart/form-data" } 这个必须要有@using (Html.BeginForm(Html.BeginForm("Create", "UserInfo", FormMethod.Post, new { enctype = "multipart/form-data" }))){图片@* *@} [HttpPost]public ActionResult Create(UserInfo userinfo){var file = Request.Files[0] 阅读全文
posted @ 2013-07-05 11:53 放哨De老鼠 阅读(1503) 评论(4) 推荐(0) 编辑
摘要: public ActionResult Index(int id = 1, string Keyword = ""){ViewBag.Page_Count = 10;ViewBag.CurrentPageSize = id;ViewBag.pageIndex = id;ViewBag.KeyName = Keyword;ViewBag.Keyword = "&&keyword=" + Keyword;List model = null ;if (Keyword.Length > 0){model = db.userinfo.Wher 阅读全文
posted @ 2013-07-04 11:16 放哨De老鼠 阅读(569) 评论(0) 推荐(0) 编辑
摘要: EF中使用语句 或存储过程 查询1、无参数查询var model = db.Database.SqlQuery("select* from UserInfoes ").ToList();2、有参查询var model = db.Database.SqlQuery("select* from UserInfoes where id=@ID ",new SqlParameter("@ID",id)).ToList();3、结合linq查询var model = (from p in db.userinfo.SqlQuery("s 阅读全文
posted @ 2013-07-04 11:09 放哨De老鼠 阅读(546) 评论(0) 推荐(0) 编辑
摘要: 需要在库程序包管理器里依次执行以下命令:1.启用迁移功能:Enable-Migrations -ContextTypeName MvcMovie.Models.MovieDbContext2.建立初态:add-migration Initial3.自动比对差异生成迁移类:add-migration AddRatingMig4.将迁移应用到数据库:update-database依次执行 Enable-Migrations Add-Migration 1 (1是随便写的) Update-Database 阅读全文
posted @ 2013-07-03 12:51 放哨De老鼠 阅读(894) 评论(0) 推荐(1) 编辑
摘要: select IDENTITY(int,1,1) as SortID from tb_order仅当 SELECT 语句中有 INTO 子句时,才能使用 IDENTITY 函数。select IDENTITY(int,1,1) as SortID,* into #Temp from tb_order无法使用 SELECT INTO 语句将标识列添加到表 '#Temp',该表的列 'ID' 已继承了标识属性。 这样写才是正确的,select 后面不能包含*,不能包含ID号,必须写字段名select IDENTITY(int,1,1) as SortID,Order 阅读全文
posted @ 2013-07-02 09:22 放哨De老鼠 阅读(5588) 评论(0) 推荐(0) 编辑
摘要: 错误 2280 类型“System.Web.Mvc.ModelClientValidationRule”同时存在于“C:\Program Files\Microsoft ASP.NET\ASP.NET Web Pages\v2.0\Assemblies\System.Web.WebPages.dll”和“C:\Program Files\Microsoft ASP.NET\ASP.NET MVC 3\Assemblies\System.Web.Mvc.dll”中 D:\workspace\ecard26b\v 2.60\src\ecard.web\Global.asax.cs 310 37 E 阅读全文
posted @ 2013-07-01 17:33 放哨De老鼠 阅读(188) 评论(0) 推荐(0) 编辑
摘要: ALTER procedure [dbo].[sp_Common_GetDataPaging_ReturnDataCount] ( @PageNumber int, --当前的页码 @PageSize int, --每页显示的数据量 @DataCount int out --总数据量 ) as begindeclare @BNum int declare @ENum int set @BNum = (@PageNumber-1)*@PageSize+1 set @ENum = @PageNumber*@PageSizeselect ROW_NUMBER() over( order by id. 阅读全文
posted @ 2013-06-10 11:33 放哨De老鼠 阅读(346) 评论(0) 推荐(0) 编辑
摘要: string str = "11||22||33";string[] sArray = Regex.Split(str, "||", RegexOptions.IgnoreCase);foreach (string i in sArray)Response.Write(i.ToString() + ""); 阅读全文
posted @ 2013-05-27 09:56 放哨De老鼠 阅读(220) 评论(0) 推荐(0) 编辑
摘要: //注册JSif (!Page.ClientScript.IsClientScriptIncludeRegistered(GetType(), "abc")){Page.ClientScript.RegisterClientScriptInclude(GetType(), "abc", ResolveClientUrl("js文件路径"));}//注册CSSClientScript.RegisterClientScriptBlock(GetType(), "regCss", ""); 阅读全文
posted @ 2013-05-16 11:44 放哨De老鼠 阅读(272) 评论(0) 推荐(0) 编辑
摘要: js分页 js表格 js随机内容 阅读全文
posted @ 2013-05-10 17:00 放哨De老鼠 阅读(304) 评论(0) 推荐(0) 编辑
摘要: 表名:tb_WebSitePromotion字段1:ID字段2:WebSiteInfoID网站编号字段3:StartDate生效开始日期字段4:EndDate生效结束日期select a.*from tb_WebSitePromotion as ainner join tb_WebSitePromotion as b on a.WebSiteInfoID=b.WebSiteInfoID and a.IDb.ID and ((a.StartDate >=b.StartDate and a.StartDate=a.StartDate and b.StartDate<isnull(a.E 阅读全文
posted @ 2013-05-02 15:02 放哨De老鼠 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 该存储过程必须在master 数据库下执行 调用 在当前数据库下 调用 如 sp_killspid 数据库名Create proc sp_killspid (@dbname varchar(20)) as begin declare @sql nvarchar(500) declare @spid int set @sql='declare getspid cursor for select spid from sysprocesses where dbid=db_id('''+@dbname+''')' exec (@sql) 阅读全文
posted @ 2013-05-02 13:55 放哨De老鼠 阅读(205) 评论(0) 推荐(0) 编辑
摘要: SELECT 表名 = d.name ,表说明 = case when a.colorder=1 then isnull(f.value,'') else '' end,字段序号 = a.colorder,字段名 = a.name,标识 = case when COLUMNPROPERTY( a.id,a.name,'IsIdentity')=1 then '√'else '' end,主键 = case when exists(SELECT 1 FROM sysobjects where xtype='P 阅读全文
posted @ 2013-05-02 13:47 放哨De老鼠 阅读(397) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页