摘要:
ParentWin:<input id="btnOpenWin" type="button" value="打开子窗体" onclick="window.open('ChildWin.aspx','','width=200,height=30');"/>ChildWin:<input id="btnSave" type="button" value="保存" onclick="al 阅读全文
posted @ 2013-01-19 17:24
yellowshorts
阅读(131)
评论(0)
推荐(0)
摘要:
<asp:Button ID="btnRedirect" runat="server" Text="使用Redirect" OnClick="btnRedirect_Click" /> <asp:Button ID="btnTransfer" runat="server" Text="使用Transfer" OnClick="btnTransfer_Click" /> <asp:Button ID=&quo 阅读全文
posted @ 2013-01-19 17:22
yellowshorts
阅读(232)
评论(0)
推荐(0)
摘要:
private double sum = 0; //GridView控件的行数据绑定事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { if (!string.IsNullOrEmpty(e.Row.Cells[2].Text)) //销售金额不为空 { ... 阅读全文
posted @ 2013-01-19 17:20
yellowshorts
阅读(124)
评论(0)
推荐(0)
摘要:
<script type="text/javascript"> function fixHead() { var grid = document.getElementById("<%=GridView1.ClientID%>"); var grid2 = grid.cloneNode(true) for (i = grid2.rows.length - 1; i > 0; i--) grid2.deleteRow(i) ... 阅读全文
posted @ 2013-01-19 17:16
yellowshorts
阅读(154)
评论(0)
推荐(0)
摘要:
//GridView控件行数据绑定事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { //已设置公告内容列的宽度是200 //为公告内容列添加word-break属性 e.Row.Cells[2].Style.Add("word-break", "bre... 阅读全文
posted @ 2013-01-19 17:10
yellowshorts
阅读(244)
评论(0)
推荐(0)
摘要:
//GridView行数据绑定事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { string content = e.Row.Cells[2].Text; //取指定列值 e.Row.Cells[2].Text = SubStr(content, 10);//调用自定义... 阅读全文
posted @ 2013-01-19 16:59
yellowshorts
阅读(198)
评论(0)
推荐(0)
摘要:
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { GridView grid = sender as GridView; //取当前操作的GridView int rowNo = e.Row.RowIndex+1; //根据行索引加1取行号 ... 阅读全文
posted @ 2013-01-19 16:56
yellowshorts
阅读(122)
评论(0)
推荐(0)
摘要:
<script language="javascript" type="text/javascript">// <!CDATA[function btnSelect_onclick(id,name) { alert("用户ID:"+id+" 用户名:"+name) ; return false ;}// ]]></script> //GridView控件的行数据绑定事件 protected void GridView1_RowDataBound(object sender, Gr 阅读全文
posted @ 2013-01-19 16:52
yellowshorts
阅读(130)
评论(0)
推荐(0)
摘要:
//GridView控件的行数据绑定事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { //为当前行添加鼠标移入事件 e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgr... 阅读全文
posted @ 2013-01-19 16:50
yellowshorts
阅读(171)
评论(0)
推荐(0)
摘要:
//GridView行数据绑定事件 protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) //如果是数据行 { GridView grid = sender as GridView; //取当前操作的GridView //为GridView数据行的"删除方法1"按钮添加删除确认对话框 ((L... 阅读全文
posted @ 2013-01-19 16:46
yellowshorts
阅读(835)
评论(0)
推荐(0)
摘要:
private string Var; //声明变量 private string PersistenceVar//声明经过持久化处理的变量 { get { if (ViewState["PersistenceVar"] == null) { return ""; } return ViewState["PersistenceVar"].ToString(); } set ... 阅读全文
posted @ 2013-01-19 16:38
yellowshorts
阅读(234)
评论(0)
推荐(0)
摘要:
if (!IsPostBack) //如果是第一次加载页面 { if (Session["TreeNod"] == null) //如果不存在菜单树缓存对象 { BuildTreeview(); //调用生成菜单树 if (tvNavigation.Nodes.Count > 0) { Session["TreeNod"] = tvNavigation.Nodes[0]; //将... 阅读全文
posted @ 2013-01-19 16:35
yellowshorts
阅读(245)
评论(0)
推荐(0)
摘要:
RegisterClientScriptBlock: //判断是否已经注册clientScript键的客户端脚本 if (!ClientScript.IsClientScriptBlockRegistered("clientScript")) { string scriptString = "<script language=\"javascript\" type=\"text/javascript\">" + "function doClick()" + "{" 阅读全文
posted @ 2013-01-19 16:28
yellowshorts
阅读(144)
评论(0)
推荐(0)
摘要:
<script language="javascript" type="text/javascript"> function CallCSVariable() { alert("<%= Str %>"); } function CallCSMethod() { alert('<%= GetStr("this is a ") %>'); } </script> <div> <input id="Button1" ty 阅读全文
posted @ 2013-01-19 15:59
yellowshorts
阅读(384)
评论(0)
推荐(0)
摘要:
if (!this.IsPostBack) { Table Table1 = new Table(); AddRow(Table1, "姓名", "专业", "所在学样", "个人网站"); AddRow(Table1, "小明", "计算机系", "吉林大学", "http://www.mingrisoft.com"); Page.Controls.Add(Table1); } public void AddRow(Table Tab 阅读全文
posted @ 2013-01-19 15:48
yellowshorts
阅读(233)
评论(0)
推荐(0)
摘要:
<div> <span id="spanCounter"></span> <br /> <asp:TextBox ID="TextBox1" runat="server" Text="Sample Text" onkeyup="spanCounter.innerText = this.value.length;"></asp:TextBox> </div> 阅读全文
posted @ 2013-01-19 15:45
yellowshorts
阅读(127)
评论(0)
推荐(0)
摘要:
<%--页面每隔10秒刷新一次 --%> <meta http-equiv="Refresh" content="10" /> <%--指定页面使用的字符为国标汉字码--%> <meta http-equiv="Content-Type" content="text/html;Charset=gb2312" /> <%--禁止浏览器从本地的缓存中读取页面内容--%> <meta http-equiv="Pragma" conten 阅读全文
posted @ 2013-01-19 15:43
yellowshorts
阅读(124)
评论(0)
推荐(0)
摘要:
List<Person> People = new List<Person> { new Person { ID = 33, Name = "lyf"}, new Person { ID = 22, Name = "azw"} }; var query = People.Select((person, index) => new { index, person.Name }).OrderBy(itm =>itm.Name); foreach (var item in query) { ... 阅读全文
posted @ 2013-01-19 15:39
yellowshorts
阅读(1855)
评论(0)
推荐(0)
摘要:
string[] Words = new string[] { "what", "is", "your", "name", "?", "my", "name", "is", "lyf","." }; var Groups = from word in Words group word by word.Length into lengthGroups //按单词长度将单词分组 orderby len 阅读全文
posted @ 2013-01-19 15:37
yellowshorts
阅读(172)
评论(0)
推荐(0)
摘要:
string path = Server.MapPath("App_Data/new.xml"); XElement xe = XElement.Load(path);//导入XML文件 //用LINQ查询Person元素 IEnumerable<XElement> element = from ee in xe.Elements("Person") select ee; //计算年龄合计 decimal oldSum = element.Sum... 阅读全文
posted @ 2013-01-19 15:36
yellowshorts
阅读(147)
评论(0)
推荐(0)
摘要:
//取“App_Data”的路径 string dir = Server.MapPath("~/App_Data"); //创建文件信息列表 List<FileInfo> files = new List<FileInfo>(); foreach (string file in Directory.GetFiles(dir)) { files.Add(new FileInfo(file));//将“App_Data”中的文件信息添加到files } //被查... 阅读全文
posted @ 2013-01-19 15:34
yellowshorts
阅读(160)
评论(0)
推荐(0)
摘要:
//取“App_Data”的路径 string dir = Server.MapPath("~/App_Data"); //创建文件信息列表 List<FileInfo> files = new List<FileInfo>(); foreach (string file in Directory.GetFiles(dir)) { files.Add(new FileInfo(file));//将“我的文档”中的文件信息添加到files } //LINQ查询指定文件尺寸的文... 阅读全文
posted @ 2013-01-19 15:29
yellowshorts
阅读(161)
评论(0)
推荐(0)
摘要:
//取“App_Data”的路径 string dir = Server.MapPath("~/App_Data"); //创建文件信息列表 List<FileInfo> files = new List<FileInfo>(); foreach (string file in Directory.GetFiles(dir)) { files.Add(new FileInfo(file));//将“我的文档”中的文件信息添加到files } //LINQ查询符合指定条件的文件 ... 阅读全文
posted @ 2013-01-19 15:27
yellowshorts
阅读(190)
评论(0)
推荐(0)
摘要:
//取出xml文件的全路径 string path = Server.MapPath("App_Data/new.xml"); //导入XML文件 XElement xe = XElement.Load(path); //用LINQ查找要操作的元素 IEnumerable<XElement> element = from ee in xe.Elements("Person") where ee.Attribute("IDCard").Value == "22030219771... 阅读全文
posted @ 2013-01-19 15:16
yellowshorts
阅读(196)
评论(0)
推荐(0)
摘要:
//取出xml文件的全路径 string path = Server.MapPath("App_Data/new.xml"); //导入XML文件 XElement xe = XElement.Load(path); //用LINQ查找要删除的元素 IEnumerable<XElement> element = from ee in xe.Elements("Person") where ee.Attribute("IDCard").Value == "22030219881... 阅读全文
posted @ 2013-01-19 15:15
yellowshorts
阅读(291)
评论(0)
推荐(0)
摘要:
//取出xml文件的全路径 string path = Server.MapPath("App_Data/new.xml"); //导入XML文件 XElement xe = XElement.Load(path); //用LINQ查找要修改的元素 IEnumerable<XElement> element = from ee in xe.Elements("Person") where ee.Attribute("IDCard").Value == "220302198810... 阅读全文
posted @ 2013-01-19 15:14
yellowshorts
阅读(741)
评论(0)
推荐(0)
摘要:
//取出xml文件的全路径 string path = Server.MapPath("App_Data/new.xml"); //导入XML文件 XElement xe = XElement.Load(path); //创建一个新节点 XElement newPerson = new XElement("Person", new XAttribute("IDCard", "22030219881012***"), new XElement("Name", "李四"), .. 阅读全文
posted @ 2013-01-19 15:12
yellowshorts
阅读(143)
评论(0)
推荐(0)
摘要:
//设置xml文件存放的目录 string path = Server.MapPath("App_Data/new.xml"); //使用LINQ创建xml文件的内容 XDocument doc = new XDocument( new XDeclaration("1.0", "utf-8", "yes"), new XElement("People", new XElement("Person", new XAttribute("IDC... 阅读全文
posted @ 2013-01-19 15:10
yellowshorts
阅读(167)
评论(0)
推荐(0)
摘要:
DataSet ds = new DataSet();//创建数据集 string conStr = "Server=.;Database=ExpatiateAspNet;uid=sa;pwd="; //创建数据连接 using (SqlConnection con = new SqlConnection(conStr)) { //创建数据适配器 SqlDataAdapter sda = new SqlDataAdapter("select * from UserInfo", con); con.Open();... 阅读全文
posted @ 2013-01-19 15:03
yellowshorts
阅读(1432)
评论(0)
推荐(0)
摘要:
//取“Dir1”的路径 string dir1 = Server.MapPath("~/App_Data/Dir1/"); //取“Dir1”中的文件信息 List<FileInfo> files1 = new List<FileInfo>(); foreach (string file in Directory.GetFiles(dir1)) { files1.Add(new FileInfo(file)); } //取“Dir2”的路径 string d... 阅读全文
posted @ 2013-01-19 14:31
yellowshorts
阅读(287)
评论(0)
推荐(0)
摘要:
//给字符串变量赋值 string text = @"A better activation model is to allocate an object for a client only while a call is in progress from the client to the service. That way, you have to create and maintain only as many objects in memory as there are concurrent calls, not as m... 阅读全文
posted @ 2013-01-19 14:26
yellowshorts
阅读(560)
评论(0)
推荐(0)
摘要:
string text = @"var query = from info in infoList where info.AuditFlag == null || info.AuditFlag == false join emp in empList on info.SaleMan equals emp.EmployeeCode join house in houseList on info.WareHouse equals house.WareHouseCode join clien... 阅读全文
posted @ 2013-01-19 14:19
yellowshorts
阅读(199)
评论(0)
推荐(0)
摘要:
string text = @"A better activation model is to allocate an object for a client only while a call is in progress from the client to the service. That way, you have to create and maintain only as many objects in memory as there are concurrent calls, not as many objects as there are o... 阅读全文
posted @ 2013-01-19 14:15
yellowshorts
阅读(267)
评论(0)
推荐(0)
摘要:
string sourceString = "int i = 5; string s = (i % 2 == 0 ? \"偶数\" : \"奇数\");"; //查询所有的数字、标点、符号 var query = from item in sourceString where char.IsDigit(item) || char.IsSymbol(item) || char.IsPunctuation(item) select item; //显示查询结果 fo... 阅读全文
posted @ 2013-01-19 12:00
yellowshorts
阅读(133)
评论(0)
推荐(0)
摘要:
SortedDictionary<int, UserInfo> users = new SortedDictionary<int, UserInfo>(); //为泛型排序字典添加3个元素,注意键是按照3、2、1的顺序添加 users.Add(3, new UserInfo(1, "User01", "01")); users.Add(2, new UserInfo(2, "User02", "02")); users.Add(1, new UserInfo(3, "User03& 阅读全文
posted @ 2013-01-19 11:49
yellowshorts
阅读(1342)
评论(0)
推荐(0)
摘要:
List<Store> StoreList = new List<Store> { new Store { WareHouse="一号仓库", Product="电视机", Quantity=10 }, new Store { WareHouse="一号仓库", Product="电视机", Quantity=20 }, new Store { WareHouse="一号仓库", Product="洗衣机", Quantity=30 }, new St 阅读全文
posted @ 2013-01-19 11:48
yellowshorts
阅读(174)
评论(0)
推荐(0)
摘要:
//构建泛型哈希集 HashSet<UserInfo> users = new HashSet<UserInfo>(); for (int i = 0; i < 10; i++) { users.Add(new UserInfo(i % 2, "User0" + i.ToString(), "0" + i.ToString())); } //LINQ对泛型哈希集进行排序操作 var query = from item in users orderby item.UserCo... 阅读全文
posted @ 2013-01-19 11:23
yellowshorts
阅读(135)
评论(0)
推荐(0)

浙公网安备 33010602011771号