06 2012 档案

摘要:现在ASP.NET,你不但可以轻松的实现对用户输入的验证,而且,还可以选择验证在服务器端进行还是在客户端进行,再也不必考虑那么多了,程序员们可以将重要精力放在主程序的设计上了。 ASP.NET公有六种验证控件,分别如下: 控件名 功能描叙RequiredFieldValidator(必须字段验证) 用于检查是否有输入值CompareValidator(比较验证) 按设定比较两个输入RangeVal... 阅读全文
posted @ 2012-06-29 11:42 Setme 阅读(230) 评论(0) 推荐(0)
摘要:$(document).ready(function(){$(“#scrollDiv”).textSlider({line:4,speed:500,timer:3000});}); line:滚动几行;speed:滚动速度;timer:自动滚动间隔;演示地址:http://www.css88.com/demo/textSlider/textSlider.html下载地址:http://www.cs... 阅读全文
posted @ 2012-06-21 14:20 Setme 阅读(4996) 评论(0) 推荐(1)
摘要:IndexOf-搜索函数 int String.IndexOf(string value); 返回字符串中第一次出现子字符串的字符位置,从0开始,未找到子字符串返回-1。 int String.IndexOf(string value,int startIndex); 同上,但是从字符串的startIndex位置开始搜索,一直到字符串末尾。 int String.IndexOf(string v... 阅读全文
posted @ 2012-06-19 15:33 Setme 阅读(2710) 评论(0) 推荐(0)
摘要:解析HTML结构。 加载外部脚本和样式表文件。 解析并执行脚本代码。 构造HTML DOM模型。 加载图片等外部文件。 页面加载完毕。 加载顺序实例: <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Title</title> <style type="text/css"> ... 阅读全文
posted @ 2012-06-07 16:33 Setme 阅读(6826) 评论(0) 推荐(2)
摘要:<asp:Button ID="buttonSelect" runat="server" Text="button"/> 目前已知办法: 1、可通过位置方式获取: $("input[type=submit]").eq(第几个位置); 2、可通过控件ID获取: $("[id$=buttonSelect]"); 3、可通过DOM节点方式获取 阅读全文
posted @ 2012-06-06 09:22 Setme 阅读(295) 评论(0) 推荐(0)
摘要:@ Master:定义 ASP.NET 页分析器和编译器使用的特定于母版页(.master 文件)的属性。详见MSDN相关属性。 1.创建简单的嵌套母版页首先创建一个母版页做主母版页,再新建一个母版页,并选择主母版页为其母版,则完成嵌套,主要应用于主网站中嵌套分类母版。 2.访问母版页上的控件Master:获取嵌套母版页方案中当前母版页的父级母版页FindControl:在当前的命名容器中搜索带指... 阅读全文
posted @ 2012-06-05 18:40 Setme 阅读(287) 评论(0) 推荐(1)
摘要:Response.ContentType = "application/octet-stream";Response.AppendHeader("Content-Disposition", "attachment; filename=xxx.mht"); 阅读全文
posted @ 2012-06-05 18:37 Setme 阅读(243) 评论(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 阅读(2079) 评论(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 阅读(254) 评论(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 阅读(225) 评论(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 阅读(169) 评论(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 阅读(174) 评论(0) 推荐(0)
摘要:/// <summary> /// 过滤html标签 /// </summary> /// <param name="Htmlstring"></param> /// <returns></returns> public static string NoHTML(string Htmlstring) ... 阅读全文
posted @ 2012-06-05 18:19 Setme 阅读(233) 评论(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 阅读(235) 评论(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 阅读(293) 评论(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 阅读(886) 评论(2) 推荐(0)
摘要:验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGenerate。说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。异常详细信息: System.Web.HttpException: 验证视图状态 MAC 失败。如果此应用程序由网络场或群集承载,请确保 <machineKey> 配置指定了相同的 validationKey 和验证算法。不能在群集中使用 AutoGe 阅读全文
posted @ 2012-06-05 18:00 Setme 阅读(25609) 评论(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 阅读(208) 评论(0) 推荐(0)
摘要:内连接也叫连接,是最早的一种连接,最早被称为普通连接或自然连接。内连接是从结果中删除其他被连接表中没有匹配行的所有行,所以内连接可能会丢失信息。内连接的语法:SELECT fieldlist FROM table1 [INNER] join table2 ON table1.column=table2.column一个表中的行和与另外一个表中的行匹配连接。表中的数据决定了如何对这些行进行组合。从每一个表中选取一行,根据这些列的值是否相同,组合方式分为一对一、多对一和多对多的关系。1.一对一关系当连接的两个表,两个连接列的值完全相同,则两个表连接相当于一对一的关系。下面在“pubs”数据库中“t 阅读全文
posted @ 2012-06-05 14:07 Setme 阅读(3107) 评论(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 阅读(487) 评论(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 阅读(3062) 评论(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 阅读(38456) 评论(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 阅读(2925) 评论(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 阅读(248) 评论(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 阅读(1179) 评论(0) 推荐(0)
摘要:为了演示CalendarExtender丰富的使用方法,本例子一共使用了两个TextBox控件、一个Image控件和两个CalendarExtender组件。我会通过两个TextBox演示CalendarExtender两种不同的使用方法。我们将以上控件都拖进设计界面,代码如下:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <ajaxToolkit:CalendarExtender ID="CalendarExtender1" runat 阅读全文
posted @ 2012-06-05 11:25 Setme 阅读(4084) 评论(0) 推荐(0)
摘要:以前总手写TAB选项卡,总要写很多代码,ASP.net里AJAX - Container已为我们提供了选项卡功能,但默认样式比较难看,今天研究了一下它的CSS样式,自已写了一个给大家分享一下:最终效果:所用背景图片如下:Tab_Option_bg.gif Tab_Option_bg_ON.gif Tab_Option_bg_OFF.gif Aspx文件:<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager><cc1:TabCont 阅读全文
posted @ 2012-06-01 20:52 Setme 阅读(4169) 评论(0) 推荐(1)
摘要:<meta http-equiv="Refresh" content="1;URL=inner.aspx " />页面1秒以后跳转到指定页 阅读全文
posted @ 2012-06-01 20:11 Setme 阅读(465) 评论(0) 推荐(0)
摘要:<iframe id="frmleft" name="frmleft" frameborder="0" onload="this.height=frmleft.document.body.scrollHeight"></iframe> 阅读全文
posted @ 2012-06-01 20:10 Setme 阅读(133) 评论(0) 推荐(0)
摘要:首先看看这个链接,出现的页面横向出现滚动条,把页面撑大,这是我们不希望看到的!http://www.cnblogs.com/tuyile006/archive/2006/05/07/393254.htmlTextBox设置为多行的时候,如果输入的内容太多,则在前台,表格会被撑的很大,这个问题的确是有点烦!这个问题说大不大,说小不小,既然博客园都出现了这个问题,我想有必要再讨论一下解决的方案.当我们要实现TextBox实现多行的时候,我们要设置TextMode为MultiLine,如果要实现自动换行,我们要设置Wrap为True,那么这样我们输入数据的时候,在TextBox里则能自动换行了,那么 阅读全文
posted @ 2012-06-01 20:08 Setme 阅读(279) 评论(0) 推荐(0)
摘要:<head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>无标题文档</title><script type="text/javascript"> function countDown(secs,surl){ var jumpTo = document.getElementById('jumpTo'); jumpTo.innerHTML=secs; if 阅读全文
posted @ 2012-06-01 20:05 Setme 阅读(4964) 评论(0) 推荐(0)