摘要: @ Master:定义 ASP.NET 页分析器和编译器使用的特定于母版页(.master 文件)的属性。详见MSDN相关属性。 1.创建简单的嵌套母版页首先创建一个母版页做主母版页,再新建一个母版页,并选择主母版页为其母版,则完成嵌套,主要应用于主网站中嵌套分类母版。 2.访问母版页上的控件Master:获取嵌套母版页方案中当前母版页的父级母版页FindControl:在当前的命名容器中搜索带指... 阅读全文
posted @ 2012-06-05 18:40 Setme 阅读(261) 评论(0) 推荐(1) 编辑
摘要: Response.ContentType = "application/octet-stream";Response.AppendHeader("Content-Disposition", "attachment; filename=xxx.mht"); 阅读全文
posted @ 2012-06-05 18:37 Setme 阅读(238) 评论(0) 推荐(0) 编辑
摘要: Codeusing System;using System.Data;using System.Configuration;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;u... 阅读全文
posted @ 2012-06-05 18:36 Setme 阅读(2063) 评论(0) 推荐(0) 编辑
摘要: private static string TextFromFile() { string sLine = ""; using (StreamReader objReader = new StreamReader(HttpContext.Current.Server.MapPath("Default.aspx"), System.Text.Encodin... 阅读全文
posted @ 2012-06-05 18:33 Setme 阅读(242) 评论(0) 推荐(0) 编辑
摘要: 无法获得控件说明是母版页与内容页事件顺序问题。div.Controls.Add(ck);之后去查找应该是可以找到的 aspx: <div id="DIVcheck" runat="server"></div>CS:protected void CheckDataBind(){ DataSet ds = ActionBLL.GetAllList(); D... 阅读全文
posted @ 2012-06-05 18:23 Setme 阅读(191) 评论(0) 推荐(0) 编辑
摘要: private void GetControls(Control c)//c需要遍历查找的父控件{ if (c is HyperLink) { Response.Write(c.ID + "<br />"); return; } if (c.HasControls()) foreach (Control con in ... 阅读全文
posted @ 2012-06-05 18:21 Setme 阅读(159) 评论(0) 推荐(0) 编辑
摘要: protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e){ if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem) { ... 阅读全文
posted @ 2012-06-05 18:20 Setme 阅读(165) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 过滤html标签 /// </summary> /// <param name="Htmlstring"></param> /// <returns></returns> public static string NoHTML(string Htmlstring) ... 阅读全文
posted @ 2012-06-05 18:19 Setme 阅读(223) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// 添加关键字以及描述 /// </summary> /// <param name="key">关键字</param> /// <param name="des">描述</param> /// <param name="page">Page</param> pub... 阅读全文
posted @ 2012-06-05 18:12 Setme 阅读(203) 评论(0) 推荐(0) 编辑
摘要: aspx: <webdiyer:AspNetPager ID="AspNetPager" CssClass="paginator" CurrentPageButtonClass="cpb" runat="server" AlwaysShow="True" FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PageSize="21" PrevPageT 阅读全文
posted @ 2012-06-05 18:09 Setme 阅读(279) 评论(0) 推荐(0) 编辑
摘要: aspx: <%if (YesIsNoPage){%> <webdiyer:AspNetPager ID="AspNetPager" CssClass="paginator" CurrentPageButtonClass="cpb" runat="server" AlwaysShow="True" FirstPageText="Home" LastPageText="End" ... 阅读全文
posted @ 2012-06-05 18:04 Setme 阅读(871) 评论(2) 推荐(0) 编辑
摘要: 验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGenerate。说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息: System.Web.HttpException: 验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGe 阅读全文
posted @ 2012-06-05 18:00 Setme 阅读(25468) 评论(1) 推荐(1) 编辑
摘要: string path = Request.ServerVariables["SCRIPT_NAME"]; //获取URL地址string[] arr_path = path.Split("/".ToCharArray());Response.Write(arr_path[arr_path.Length - 1]); 阅读全文
posted @ 2012-06-05 17:40 Setme 阅读(178) 评论(0) 推荐(0) 编辑
摘要: 内连接也叫连接,是最早的一种连接,最早被称为普通连接或自然连接。内连接是从结果中删除其他被连接表中没有匹配行的所有行,所以内连接可能会丢失信息。内连接的语法:SELECT fieldlist FROM table1 [INNER] join table2 ON table1.column=table2.column一个表中的行和与另外一个表中的行匹配连接。表中的数据决定了如何对这些行进行组合。从每一个表中选取一行,根据这些列的值是否相同,组合方式分为一对一、多对一和多对多的关系。1.一对一关系当连接的两个表,两个连接列的值完全相同,则两个表连接相当于一对一的关系。下面在“pubs”数据库中“t 阅读全文
posted @ 2012-06-05 14:07 Setme 阅读(2980) 评论(0) 推荐(0) 编辑
摘要: 外连接外连接则扩充了内连接的功能,会把内连接中删除表源中的一些保留下来,由于保留下来的行不同,把外连接分为左外连接、右外连接和全外连接这3种连接。1.左外连接左外连接保留了第一个表的所有行,但只包含第二个表与第一表匹配的行。第二个表相应的空行被放入NULL值。左外连接的语法:use studentSELECT fieldlist FROM table1 left join table2 ON table1.column=table2.column下面把“student”表和“grade”表左外连接,第一个表“student”有不满足连接条件的行。在查询分析器中输入的SQL语句如下:use st 阅读全文
posted @ 2012-06-05 13:55 Setme 阅读(389) 评论(0) 推荐(0) 编辑
摘要: select top 5 * FROM News where NewsTypeID=3 and (NewsIsRecommend=true and NewsIsInvisible=false) order by NewsTime desc换成select * FROM (select top 5 * from News where NewsTypeID=3 and (NewsIsRecommend=true and NewsIsInvisible=false)) order by NewsTime desc 阅读全文
posted @ 2012-06-05 13:48 Setme 阅读(2987) 评论(0) 推荐(0) 编辑
摘要: 一、使用方法:1、在页面<head>中引入ckeditor核心文件ckeditor.js<script type="text/javascript"src="ckeditor/ckeditor.js"></script>2、在使用编辑器的地方插入HTML控件<textarea><textarea id="TextArea1" cols="20" rows="2"class="ckeditor"></textar 阅读全文
posted @ 2012-06-05 13:47 Setme 阅读(38315) 评论(0) 推荐(4) 编辑
摘要: CKEDITOR.editorConfig = function (config) { config.language = 'zh-CN'; //语言 config.skin = 'v2'; //样式 config.enterMode = CKEDITOR.ENTER_BR; //回车时产生的标示 config.width = '660px'; //默认宽度 config.height = '410px'; //默认高度 config.r... 阅读全文
posted @ 2012-06-05 12:00 Setme 阅读(2903) 评论(0) 推荐(0) 编辑
摘要: 1 using System; 2 using System.Collections.Generic; 3 using System.Linq; 4 using System.Web; 5 using System.Xml; 6 7 namespace Common 8 { 9 public class Xml10 {11 private XmlDocument xmlDoc;12 13 /// <summary>14 /// xml文件名,调用次大类必须先设定xml文件名15 /// </summary>16... 阅读全文
posted @ 2012-06-05 11:49 Setme 阅读(229) 评论(0) 推荐(0) 编辑
摘要: Common:/// <summary>/// 反序列化/// </summary>/// <param name="type">对象类型</param>/// <param name="filename">文件路径</param>/// <returns></returns>public static object Load(Type type, string filename){ FileStream fs = null; try { // open th 阅读全文
posted @ 2012-06-05 11:46 Setme 阅读(1167) 评论(0) 推荐(0) 编辑