随笔分类 -  ASP.NET

C#生成树状图
摘要:库里表的结构如下:id ParentId父类ID name名称 CodeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->前台页代码如下:div>Resp... 阅读全文

posted @ 2009-08-03 17:02 悟〈--觉 阅读(1051) 评论(0) 推荐(0)

DataGrid中通过CHECKBOX来修改库里某个字段的值
摘要:前台页如下:其实主要的思路是,首先把要修改的那个字段绑定为不可见的,然后在后台的private void DataGrid1_ItemCreated(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e){ if(e.Ite... 阅读全文

posted @ 2009-07-23 09:35 悟〈--觉 阅读(386) 评论(0) 推荐(0)

对JSON格式化
摘要://处理JSON数据格式public string json(string json){string []index1=Getindex(json,"\'").Split(',');string []index2=Getindex(json,"\\“).split(',');for(int i=0;... 阅读全文

posted @ 2009-07-17 14:38 悟〈--觉 阅读(474) 评论(1) 推荐(0)

c# 将DataGrid中的项导出为Excel
摘要:this.DataGrid1.AllowPaging=false;Bind(DataGrid1,"select * from [work]");Response.Clear();Response.Charset="utf-8"; //输出string Title = this.Title.Text;... 阅读全文

posted @ 2009-07-15 17:10 悟〈--觉 阅读(6818) 评论(0) 推荐(0)

日历控件赋值
摘要:protected void Calendar1_SelectionChanged(object sender, EventArgs e) { this.TextBox1.Text = this.Calendar1.SelectedDate.ToString("yyyy-MM-dd"); } 阅读全文

posted @ 2009-06-24 18:42 悟〈--觉 阅读(231) 评论(0) 推荐(0)

DropDownList弹出树状图
摘要:using System;using System.Collections.Generic;using System.Web;using System.Data;using System.Data.OleDb;using System.Web.UI.WebControls;/// ///Common... 阅读全文

posted @ 2009-06-13 13:45 悟〈--觉 阅读(370) 评论(0) 推荐(0)

TreeView
摘要:public partial class admin_Admin_ProductFlAdd : System.Web.UI.Page{ static int id; OleDbConnection con = new OleDbConnection(DataProvider.ConnectionSt... 阅读全文

posted @ 2009-06-11 21:50 悟〈--觉 阅读(142) 评论(0) 推荐(0)

简单的存储过程传参
摘要:create proc afafs@arear varchar(16),@proname varchar(16)as select * from dbo.arear,dbo.pro where dbo.arear.arear=@arear and dbo.pro.proname=@pronamego... 阅读全文

posted @ 2009-06-02 16:53 悟〈--觉 阅读(316) 评论(0) 推荐(0)

C#(国际化介绍)
摘要:以前一直就想做那种中英文切换的功能,可一直没有时间,现在终于有时间了,最近辞职了就开始研究那个国际化在网上找了点资料后,自己慢慢做个例子如下 在这里了为方便说明就做中英文切换 个人理解的原理如下: 我们现在做的是中英切换的所以我们会用到两个库,一个中文,一个英文 当我们点那个英文的时候从连接英文库,... 阅读全文

posted @ 2009-05-17 02:34 悟〈--觉 阅读(2595) 评论(0) 推荐(0)

后台调用webcofing里的相关项
摘要:我在Webconfig的里手动加了用以下代码来获取Value的值在.NET2.0以上是用WebConfigurationManager.AppSettings.Get("upfile");需要导入using System.Web.Configuration;即可 ConfigurationManag... 阅读全文

posted @ 2009-05-11 16:12 悟〈--觉 阅读(203) 评论(0) 推荐(0)

错误在哪?
摘要:public class Test { int i; staticint j; void A() { i=1; j=1; } staticvoid A() { i=1;//问题出在这里,在静态方法中只有使用静态的变量 j=1;} } 阅读全文

posted @ 2009-04-27 22:03 悟〈--觉 阅读(190) 评论(1) 推荐(0)

C#面试题
摘要:一列数的规则如下: 1、1、2、3、5、8、13、21、34......求第30位数是多少, 用递归算法实现。 答:public class MainClass { public static void Main() { Console.WriteLine(Foo(30)); }... 阅读全文

posted @ 2009-03-25 23:37 悟〈--觉 阅读(200) 评论(0) 推荐(0)

练习
摘要:using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using Syste... 阅读全文

posted @ 2009-03-21 00:05 悟〈--觉 阅读(146) 评论(0) 推荐(0)

正则表达式去更改
摘要:string test = "asdfasfadfasdfadsfafdsafasadsfsafasf"; string aa = Regex.Replace(test, @"]+>", ""); Response.Write(aa); 运行结果如下: asdfasfa href="#">adf... 阅读全文

posted @ 2009-03-11 22:00 悟〈--觉 阅读(347) 评论(1) 推荐(0)

Repeater嵌套与判断'checkbox'是否选中
摘要:bgcolor="#FBCC93" border="0"> 科目名称 价格 课时 试听 报名 > &isfree=1" target="_blank"> ' onclick="IsChecked(this);" /> ... 阅读全文

posted @ 2009-02-17 20:15 悟〈--觉 阅读(863) 评论(0) 推荐(0)

正则表达式(年-月-日)
摘要:^((((1[6-9]|[2-9]\d)\d{2})-(0?[13578]|1[02])-(0?[1-9]|[12]\d|3[01]))|(((1[6-9]|[2-9]\d)\d{2})-(0?[13456789]|1[012])-(0?[1-9]|[12]\d|30))|(((1[6-9]|[2-... 阅读全文

posted @ 2009-02-16 20:22 悟〈--觉 阅读(718) 评论(0) 推荐(0)

Access to the path '' is denied.解决方案
摘要:我最近在做一个读写文件的东西 在我本地测试正常,但一上传到服务器上的时候,那个就提示 Access to the path '路径' is denied. 我在网上找了很多资料,最后终于解决了,原来是因为在该文件的上级文件夹没有修改权限, 也就是说,那个user用户没有修改的权限 我们只要把上面的... 阅读全文

posted @ 2009-01-06 11:12 悟〈--觉 阅读(10161) 评论(5) 推荐(1)

读写文件操作
摘要:前台页代码如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1@PageLanguage="C#"AutoEventWireup="true"C... 阅读全文

posted @ 2009-01-06 10:58 悟〈--觉 阅读(801) 评论(0) 推荐(0)

C#中属性和索引器之间的比较
摘要:属性的特点如下: 1。允许像调用公共数据成员一样调用方法。 2。可通过简单的名称进行访问。 3。可以为静态成员或实例成员。 4。属性的 get 访问器没有参数。 5。属性的 set 访问器包含隐式 value 参数 索引器的特点如下: 1。允许对一个对象本身使用数组表示法来访问该对象内部集合中的元素... 阅读全文

posted @ 2008-12-31 11:43 悟〈--觉 阅读(363) 评论(0) 推荐(0)

如何:使用正则表达式搜索字符串
摘要:代码如下: Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->1classTestRegularExpressions 2{ 3staticvoidMai... 阅读全文

posted @ 2008-12-20 15:47 悟〈--觉 阅读(291) 评论(0) 推荐(0)