上一页 1 ··· 3 4 5 6 7 8 9 下一页
摘要: 现在SilverLight越来越火了,我笨鸟先飞,能学多少学多少,做了一个简单的程序源码下载地址:/Files/zhuiyi/ChangeColor.zip运行效果图:在写这个的时候发现了很多问题,StackPanel(用它显示背景颜色),这个控件感觉有点像WinForm里的Panel控件,但给他的背景颜色赋值的时候去和Panel不一样,还有,就是透明度的滑动条,不能设置初始值,如果设置了就会报错(XXX未实例化之类的类错),只能在后台代码里设置,不知道是为什么。。后来在网上找点资料总算是跑起来了,哈哈,我的第一个SilverLight程序就这样诞生了,再接再力! 阅读全文
posted @ 2011-05-28 19:47 ゞ追忆o0ゞ 阅读(567) 评论(1) 推荐(1) 编辑
摘要: 自动完成也不是什么新技术了,在一些较好的网站上都能看到其应用,下面就把代码贴出来(仅限跟我同一级别的菜鸟观看……老鸟请路过……)需要一个WebService 我也懒得改名子,就直接叫WebService.asmx; 为什么要用WebService? 其实我也不太清楚,只知道AutoCompleteExtender需要三个最为关键的属性:ServicePath="WebService.asmx"ServiceMethod="GetWordList"TargetControlID="txtText"如果知道这三个属性的话,也许就清楚为什么 阅读全文
posted @ 2011-05-27 23:19 ゞ追忆o0ゞ 阅读(1134) 评论(1) 推荐(0) 编辑
摘要: 例如:http://www.baidu.com/view.aspx?id=1 和http://www.baidu.com/view-1.aspx 访问的页面相同;只需要全局应用程序类的Application_BeginRequest中添加如下代码:protectedvoidApplication_BeginRequest(objectsender,EventArgse){//使用正则表达式判断格式;View-12.aspxRegexreg=newRegex(@".+View-(\d+).aspx");//获取请求的路径进行匹配varmatch=reg.Match(Reque 阅读全文
posted @ 2011-05-21 16:45 ゞ追忆o0ゞ 阅读(379) 评论(0) 推荐(0) 编辑
摘要: usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Web.Security;usingSystem.Web.SessionState;namespace全局应用程序类Global应用{publicclassGlobal:System.Web.HttpApplication{protectedvoidApplication_Start(objectsender,EventArgse){//程序第一次运行;}protectedvoidSession_Start(objec 阅读全文
posted @ 2011-05-21 15:52 ゞ追忆o0ゞ 阅读(1367) 评论(0) 推荐(0) 编辑
摘要: 一般处理程序代码:usingSystem;usingSystem.Web;usingAjax无刷新删除.DataSetDeleteDataTableAdapters;namespaceAjax无刷新删除{///<summary>///DeleteDataById的摘要说明///</summary>publicclassDeleteDataById:IHttpHandler{publicvoidProcessRequest(HttpContextcontext){context.Response.ContentType="text/plain";int 阅读全文
posted @ 2011-05-21 13:02 ゞ追忆o0ゞ 阅读(2963) 评论(1) 推荐(0) 编辑
摘要: 源码下载:点击下载强类型的DataSet中添加分页的方法:GetPageData(startRowIndex,endRowIndex) 和SelectCount()两个方法;GetPageData代码:里面的参数自己添加,因为VS不支持over();select*from(SELECTId,IpAddress,Comment,PostDate,row_number()over(orderbypostdate)asrownumFROMdbo.T_Comment)twheret.rownum>=@startRowIndexandt.rownum<=@endRowIndexSelectC 阅读全文
posted @ 2011-05-20 15:59 ゞ追忆o0ゞ 阅读(763) 评论(1) 推荐(0) 编辑
摘要: 数据库字段:Id(主键,自增),Name(商品名称),Price(商品单价)添加数据集DataSetProducts ,添加方法:GetDataByName() ----->对应SQL:SELECTid,name,priceFROMdbo.T_Productwherename=@name新建一般处理程序:GetPrice.ashx代码:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingAJAX.DataSetProductsTableAdapters;namespaceAJA 阅读全文
posted @ 2011-05-19 15:08 ゞ追忆o0ゞ 阅读(866) 评论(1) 推荐(0) 编辑
摘要: 为了简单明了,我只在html中测试;注释里写的很清楚,我就不多废话了;很多家公司在面试的时候可能会让你不使用任何Ajax的框架实现Ajax效果,虽然这段代码看上去挺痛苦,但也没有别的办法,记不记也得记(其实理解起来就没那么难记了……)readyState表示XMLHttpRequest对象的处理状态:0:XMLHttpRequest对象还没有完成初始化。1:XMLHttpRequest对象开始发送请求。2:XMLHttpRequest对象的请求发送完成。3:XMLHttpRequest对象开始读取服务器的响应。4:XMLHttpRequest对象读取服务器响应结束。<!DOCTYPEht 阅读全文
posted @ 2011-05-19 10:36 ゞ追忆o0ゞ 阅读(785) 评论(3) 推荐(0) 编辑
摘要: 只要在Web.Config中添加如下代码即可。 <system.web><customErrorsmode="On"defaultRedirect="~/Error.aspx" <!--全局性的 推荐mode为RemoteOnly:本机查看详细错误信息,其他机器查看定制的错误页面 --><errorstatusCode="404"redirect="~/404.html"/> <!--局部性的,可以添加404,403等已知错误--></customErro 阅读全文
posted @ 2011-05-18 17:46 ゞ追忆o0ゞ 阅读(318) 评论(0) 推荐(0) 编辑
摘要: 行数:GridView1.Rows.Count;列数:GridView1.Columns.Count; 阅读全文
posted @ 2011-05-18 16:21 ゞ追忆o0ゞ 阅读(7152) 评论(0) 推荐(0) 编辑
摘要: 第三方控件下载地址:http://www.webdiyer.com/Controls/AspNetPager/Downloads实现最基本的高效分页 需要两个存储过程,第一个是获取全部数据数量的SQL,第二个是分页用的SQL语句了先上SQL代码:分页用的存储过程CREATEPROCEDUREProc_GridView_Pager@startIndexint,@endIndexintASBEGINselect*from(selecta.id,a.saleName,a.price,a.count,a.amount,b.Name,a.inDate,row_number()over(orderbya. 阅读全文
posted @ 2011-05-18 13:26 ゞ追忆o0ゞ 阅读(425) 评论(0) 推荐(0) 编辑
摘要: HeaderTemplateRowDataBound设置GirdView 的DataKeyNames="Name"即数据源中的字段,我设置的是:Name; 添加GridView事件: RowDataBound 在事件事首先判断行的类型是不是数据行;因为第一行通常是 HeaderTemplate;(图中的第一行就是表头,如编号,标识码,商品名称。。。。) 在当前行中查换DropDownList的Id;DropDownListddlInType=e.Row.FindControl("ddlInType")asDropD... 阅读全文
posted @ 2011-05-17 07:55 ゞ追忆o0ゞ 阅读(4405) 评论(0) 推荐(0) 编辑
摘要: constraint 外键表名_id_fk foreign key (外键字段名) references 主表名(主表id)createtableFirNav(idintprimarykeyidentity(1,1)notnull,navNamevarchar(10)notnull,);createtableSecNav(idintprimarykeyidentity(1,1)notnull,navNamevarchar(10)notnull,firIdint,constraintSecNav_id_fkforeignkey(firId)referencesFirNav(id));create 阅读全文
posted @ 2011-05-16 15:19 ゞ追忆o0ゞ 阅读(821) 评论(0) 推荐(0) 编辑
摘要: foreach(GridViewRowgvringvInBillList.Rows){TextBoxt=gvr.FindControl("TextBox1")asTextBox;if(t!=null){t.Text="给TextBox1赋值";}}这个方法真的很实用;把代码放到Page_Load中;其实在GridView的模板中操作真挺头疼的;也许是我真的好菜好菜;其实其他控件还好,最疼头的应该是DropDownList吧,这个方法同样受用;protectedvoidPage_Load(objectsender,EventArgse){if(!IsPos 阅读全文
posted @ 2011-05-16 14:32 ゞ追忆o0ゞ 阅读(3984) 评论(0) 推荐(0) 编辑
摘要: protectedvoidGridView1_RowDataBound(objectsender,GridViewRowEventArgse){EnableViewState=false;if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Attributes.Add("onmouseover","currentcolor=this.style.backgroundColor;this.style.backgroundColor='#CCCCFF'");e.Row.Attributes. 阅读全文
posted @ 2011-05-16 09:35 ゞ追忆o0ゞ 阅读(366) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2011-05-16 05:30 ゞ追忆o0ゞ 阅读(6) 评论(0) 推荐(0) 编辑
摘要: 这里使用了SQL2005以上版本的内置函数 row_number()方法;over里是根据什么进么排序; rownum为子表的别名;wheret.rownum>=11andt.rownum<=20 以出十条记录;select*from(selectId,Name,row_number()over(orderbyid)asrownumfromcategorywhereid>30)twheret.rownum>=11andt.rownum<=20 阅读全文
posted @ 2011-05-13 12:20 ゞ追忆o0ゞ 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1, 获取当前行的行号: int index = ((ListViewDataItem)e.Item).DisplayIndex;2,获取当前行的主键: int id = Convert.ToInt32(ListView1.DataKeys[index].value);protectedvoidListView1_ItemCommand(objectsender,ListViewCommandEventArgse){//获取当前行号;intindex=((ListViewDataItem)e.Item).DisplayIndex;//获取当前行号的主键;intid=Convert.ToInt3 阅读全文
posted @ 2011-05-12 11:53 ゞ追忆o0ゞ 阅读(443) 评论(0) 推荐(1) 编辑
摘要: 在Aspx页中的代码:<EditItemTemplate><asp:DropDownListID="DropDownList1"runat="server"><asp:ListItemValue="男">男</asp:ListItem><asp:ListItemValue="女">女</asp:ListItem></asp:DropDownList></EditItemTemplate>添加事件:ItemUpdating 阅读全文
posted @ 2011-05-11 06:23 ゞ追忆o0ゞ 阅读(1933) 评论(0) 推荐(0) 编辑
摘要: 教程地址:http://www.cnblogs.com/atao/category/209358.htmlNPOI文件包:http://u.115.com/file/aqr5pjb7程序源码:http://u.115.com/file/bhvr12dq代码中数据库链接字符串自己修改,还有对应的字段名之类的信息;新建一个Handler.ashx(一般处理程序) 代码如下:usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Web;usingSystem.Data;usingSystem.Data.Sql 阅读全文
posted @ 2011-05-05 04:43 ゞ追忆o0ゞ 阅读(2596) 评论(3) 推荐(1) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 下一页