摘要: 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 阅读(121) 评论(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 阅读(225) 评论(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 阅读(110) 评论(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 阅读(144) 评论(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 阅读(234) 评论(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 阅读(187) 评论(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 阅读(109) 评论(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 阅读(122) 评论(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 阅读(157) 评论(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 阅读(795) 评论(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 阅读(224) 评论(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 阅读(229) 评论(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 阅读(133) 评论(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 阅读(372) 评论(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 阅读(226) 评论(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 阅读(121) 评论(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 阅读(117) 评论(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 阅读(1841) 评论(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 阅读(148) 评论(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 阅读(138) 评论(0) 推荐(0) 编辑