Spiga

随笔档案 - 2008年8月

为TreeView的节点添加右键菜单(Add ContextMenu to ASP.NET TreeView)

2008-08-29 18:39 by LanceZhang, 3720 visits, 网摘, 收藏, 编辑
摘要: 阅读全文

TreeView大数据量绑定的优化方案(the Plenty of data issue of ASP.NET TreeView)

2008-08-29 17:41 by LanceZhang, 1124 visits, 网摘, 收藏, 编辑
摘要:In that scenario, I have some suggestions:First, please try to keep the node number of TreeView less than 1000, we can find that advice there:http://msdn.microsoft.com/en-us/library/ms529261.aspxRende... 阅读全文

使用JavaScript选择DataGrid行的方法汇总(Select row of DataGrid by JavaScript)

2008-08-29 13:21 by LanceZhang, 558 visits, 网摘, 收藏, 编辑
摘要:前些天发了一篇 使用JavaScript选择GridView行的方法汇总(Select row of GridView by JavaScript) 有朋友反馈说不适用于DataGrid,确实,如果要在DataGrid的行中添加JavaScript事件捕捉,必须用下面的代码:[代码] 阅读全文

JavaScript能访问客户SQL数据库?能!(Access a client side MSSQL database by JavaScript)

2008-08-27 19:56 by LanceZhang, 821 visits, 网摘, 收藏, 编辑
摘要:JavaScript能访问客户SQL数据库?能!真的能!要求:SQL Server2000(其它版本没试过),且数据库必须安装了WMI扩展(WMI SQL Server Administration Provider,能在SQL Server2000安装光盘的"x86otherwmi" 目录下找到)好了,接下来我们试试代码吧:(code from http://www.devarticles.co... 阅读全文

获得TextBox中光标的位置(get the cursor position in a TextBox or InputText)

2008-08-27 19:45 by LanceZhang, 700 visits, 网摘, 收藏, 编辑
摘要:使用JavaScript实现:[代码] 阅读全文

捕获超链接的Ctrl+Click事件(handling onclick event on a hyperlink when Ctrl key is pressed)

2008-08-27 19:38 by LanceZhang, 536 visits, 网摘, 收藏, 编辑
摘要:(奇怪,不知道客户要这个效果做什么)效果:如果点击超链接,将正常导向;如果按住Ctrl键并点击超链接,将执行一段JS代码,并且浏览器不会导向或打开新页面[代码] 阅读全文

点击“后退”按钮时不保存前一个网页中文本框的值(empty the textbox in previous page when "BACK" button is clicked )

2008-08-27 17:21 by LanceZhang, 604 visits, 网摘, 收藏, 编辑
摘要:页面上有TextBox,供用户输入数据,当用户点击页面上的超链接时会进入另一个页面,这时候,再点击浏览器“后退”按钮,就会回到原来的页面,并显示刚才在TextBox中输入的文字。然而,有些时候这些数据是机密的,不能在这种情况下显示,于是问题就产生了。。网上有很多尝试方法,比如设置meta、关闭ViewState等等,我试过,都没用,我目前最好的办法就是使用JavaScrip... 阅读全文

ModalPopupExtender使用技巧( operate ModalPopupExtender by JavaScript)

2008-08-27 16:02 by LanceZhang, 3733 visits, 网摘, 收藏, 编辑
摘要:ModalPopupExtender是个非常好用的AJAX控件, 网上有很多教程,但大多没有提起它的一些使用技巧:1.简单应用:常用属性:TargetControlID:用于触发弹出面板的控件。OkControlID:弹出面板中的确认按钮,用于确认新的样式。 OnOkScript:当单击确认按钮后,关闭样式面板后,执行脚本。CancelControlID:样式面板中的取消按钮,用于取消应用样式。P... 阅读全文

使用JavaScript选择GridView行的方法汇总(Select row of GridView by JavaScript)

2008-08-26 19:19 by LanceZhang, 1083 visits, 网摘, 收藏, 编辑
摘要:先说说我的方法吧,不是最好的,却是代码量最少的一行:[代码]呵呵有点夸张了,具体做法是在GridView的RowDataBound事件里写这么写:[代码]原理很简单,在ASP.NET的页面Render时,GridView的选择、删除、编辑 等事件会产生简单的postback 参数,分别是select$, Update$, Edit$...这样就给我们带来了很大的便利,在上面的例子中,就使用了Sel... 阅读全文

CSS+DIV布局,一个列宽影响另一个列宽,使总宽度自适应(CSS+DIV Layout, one column's width depend on the other's)

2008-08-26 18:47 by LanceZhang, 1415 visits, 网摘, 收藏, 编辑
摘要:一个客户说要用DIV+CSS布局,两列,其中导航列宽度不确定(由里面的TreeView控件确定),而与它并列的内容列宽度要做到自适应,也就是内容列宽度+导航列宽==固定值(总宽度)但是,内容列宽度 和导航列宽 都没有一个定值,而网上的大多自适应列宽代码都是基于一个定值的无奈,我写Winform出身的对CSS+DIV知之甚少,只能通过JavaScript来完成了,效果还可以,IE7.0和Firefo... 阅读全文

按需求定制ASP.NET Calendar控件(Customize the ASP.NET Calendar Control)

2008-08-26 18:26 by LanceZhang, 780 visits, 网摘, 收藏, 编辑
摘要:如今各种各样的日历控件满天飞(参见http://www.cnblogs.com/blodfox777/archive/2008/08/13/1266639.html),使用ASP.NET Calendar控件的朋友貌似不多了,但今天一个客户的古怪问题却让我想起了它的一个大优点:可以按照自己的要求进行定制!问:Scenario: I have a calendar control in an asp... 阅读全文

用__postback传递JavaScript变量到c#(pass a js variable to C# by a __postback )

2008-08-26 09:30 by LanceZhang, 472 visits, 网摘, 收藏, 编辑
摘要:之前发过用POST方式的http://www.cnblogs.com/blodfox777/articles/1271912.html而用__postback比较高阶,代码出自NC01[代码][代码] 阅读全文

HTML在线编辑器29个( 29 Rich Editor Controls that you can use with ASP.NET)

2008-08-25 17:52 by LanceZhang, 3961 visits, 网摘, 收藏, 编辑
摘要:RadEditor (Telerik). AJAX-enabled.WebHtmlEditor (Infragistics). Part of the NetAdvantage for ASP.NET suite (I think).Cute Editor (CuteSoft)FreeTextBox (FreeTextBox.com). Free for basic edition. Source... 阅读全文

判断客户浏览器是32位还是64位(detect the browser: 32bit or 64bit)

2008-08-25 17:38 by LanceZhang, 489 visits, 网摘, 收藏, 编辑
摘要:To detect the browser, please try the following code:[代码]in a 64bit lab, the following like information will be show:[代码] 阅读全文

使用OutLook 2007的请注意啦(a problem with OutLook 2007)

2008-08-25 17:25 by LanceZhang, 322 visits, 网摘, 收藏, 编辑
摘要:A customer said he has created a newsletter(HTML format) with background image, and it seems good in outlook 2003/gmail/yahoo/ie6/ie7/opera/fire-foxhowever, just in Outlook2007, the background image h... 阅读全文

页面载入时的Loading..效果(Display a "Loading.." message when page is loading)

2008-08-22 11:26 by LanceZhang, 544 visits, 网摘, 收藏, 编辑
摘要:代码是我很早之前收集的,忘记了原来的出处和自己修改了多少,如果有侵权,请联系我。[代码] 阅读全文

为Modal Popup添加美观的玻璃边框(add a glass border to your Modal Popup)

2008-08-22 09:29 by LanceZhang, 444 visits, 网摘, 收藏, 编辑
摘要:Thanks Deva to provide the code:[代码] 阅读全文

获取本机已安装的软件列表C#/VB.NET(Get the list of installed software in local pc)

2008-08-22 09:24 by LanceZhang, 1345 visits, 网摘, 收藏, 编辑
摘要:Please try the following code, it will work:[代码][代码]http://forums.asp.net/t/1306676.aspx 阅读全文

AJAX弹出窗口,永远不会被拦截的弹出窗口(create pop up window without popup blocked)

2008-08-21 18:37 by LanceZhang, 3185 visits, 网摘, 收藏, 编辑
摘要:We use window.open will be block by the browsers or blocker tools, and showModalDialogwill not be block by the browsers, but always blocked by blocker tools, the only way to open pop up window which c... 阅读全文

阻止用户关闭网页,提示保存的解决方案IE/FF/OP通用(stop page from closing, and remind user save unchanged data )

2008-08-20 20:00 by LanceZhang, 646 visits, 网摘, 收藏, 编辑
摘要:in fact the onbeforeunload event supported in Firefox browser, but the window.event is not supported in Firefox.So, we can use the following code to stop page from leaving: function SaveRemind() { w... 阅读全文

通过HTTP压缩来提高WebService性能的一些好资源(some good resource about WebService with HTTP-Compression )

2008-08-20 18:23 by LanceZhang, 599 visits, 网摘, 收藏, 编辑
摘要:文章都不错,有几篇已经被园友翻译了Retrieving Data from Web Services using Standard HTTP 1.1 Compression http://www.dotnetjunkies.ddj.com/Tutorial/90D3B3E0-6544-4594-B3BA-E41D8F381324.dcikWhy use data compression for y... 阅读全文

ASP.NET AJAX DropShadow 控件的一个BUG和解决方法(a bug of DropShadow and solution to resolve)

2008-08-20 18:11 by LanceZhang, 263 visits, 网摘, 收藏, 编辑
摘要:DropShadow控件:http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DropShadow/DropShadow.aspx既方便又使用,给广大新手们带来了很大的便利,可以轻松的为Panel(DIV)等控件制作出圆角阴影效果,只需要如下代码就可以为Panel1添加美观的效果:[代码]但今天发现了这个控件的一个BUG: 如果我们把一个应用了Sh... 阅读全文

跨页面postback时传递JavaScript变量值(pass JS variable to another page)

2008-08-20 09:24 by LanceZhang, 424 visits, 网摘, 收藏, 编辑
摘要:需要从HTML页面传值给ASP.NET页面时,可以使用,很基本,保存下来,以备没学过ASP的新手们不急之需[代码][代码] 阅读全文

IE/FF/OP兼容的JavaScript放大镜( magnifying glass by JS work in IE/FF/OP)

2008-08-19 22:33 by LanceZhang, 820 visits, 网摘, 收藏, 编辑
摘要:直接保存成htm即可查看效果[代码]转自:http://bbs.blueidea.com/thread-2812683-1-1.html 阅读全文

ASP.NET同时上传多个文件,和不使用HTMLFileInput上传的方法(resource about file upload)

2008-08-19 19:01 by LanceZhang, 1302 visits, 网摘, 收藏, 编辑
摘要:关于同时上传多个文件,目前有很多解决方案可行,如下MultiPowUploadhttp://www.element-it.com/MultiPowUpload.aspxjQuery Multiple File Upload Pluginhttp://www.fyneworks.com/jquery/multiple-file-upload/Allowing Users to Upload Mult... 阅读全文

获取JavaScript变量的类型(Finding Out Class Names of JavaScript Objects)

2008-08-19 18:42 by LanceZhang, 1290 visits, 网摘, 收藏, 编辑
摘要:翻译修改自:http://magnetiq.com/2006/07/10/finding-out-class-names-of-javascript-objects/JavaScript与一般的OO语言相比,缺少了一个获取对象类名的内置函数(如c#的GetType)。而JavaScript内置的typeof函数在判断数组和对象时,只会返回一个“object”,当然,对用户自... 阅读全文

鼠标显示大图的效果,类似淘宝(show a enlarge image in mouse hover)

2008-08-19 17:24 by LanceZhang, 1713 visits, 网摘, 收藏, 编辑
摘要:之前发布过一段代码,http://www.cnblogs.com/blodfox777/articles/1208224.html但前不久发现有个重大问题!不支持Firefox!因为window.event在IE和Opera里都是全局变量,而在Firefox中只面向即时触发的事件,所以,我们要将event作为参数传递给方法,才能兼容Firefox,修改后的代码如下,比起原来的代码,缺少了图片跟随鼠... 阅读全文

一些禁止鼠标右键的资源(resource about diable the right click)

2008-08-15 15:18 by LanceZhang, 268 visits, 网摘, 收藏, 编辑
摘要:There are many ways to disable the right click; however there seems no real way to absolutely disable the right click.No Right Click http://javascript.internet.com/page-details/no-right-click.htmlDisa... 阅读全文

网页幻灯片过渡效果大全(淡入淡出、开幕、星状散射……共17种)(IE page transitions)

2008-08-14 11:36 by LanceZhang, 3212 visits, 网摘, 收藏, 编辑
摘要:IE网页过渡效果原文地址: http://www.jansfreeware.com/articles/ie-page-transitions.html在IE5.5及以上版本的浏览器中,我们可以设置整页过渡效果,据此,我们甚至可以用IE来代替PPT了。启用网页过渡 默认情况下都已经启用了,如果需要手动启用则只需在Internet选项中: Advanced(高级) - Browsing(浏览) - E... 阅读全文

4个ASP.NET+AJAX构造聊天室的文章和实例( good article about make chat room by ASP.NET+AJAX)

2008-08-13 16:30 by LanceZhang, 1134 visits, 网摘, 收藏, 编辑
摘要:都很适合学习,有时间再翻译Use ASP.NET with AJAX to make your chat application; there are many good article and examples:Building an AJAX based chat room in ASP.NEThttp://www.codeproject.com/KB/ajax/UChat.aspxSim... 阅读全文

大量JavaScript日历控件(some free Calendar control by JS)

2008-08-13 11:17 by LanceZhang, 11292 visits, 网摘, 收藏, 编辑
摘要:RJS PopCalendar is really a good one, and there is a tutorial about it:Picking Dates with a Free RJS PopCalendar, a Free ASP.NET Popup Calendar Control http://aspnet.4guysfromrolla.com/articles/0604... 阅读全文

ASP.NET页面传值汇总 (Session / Server.Transfer / Query String / Cookie / Application )

2008-08-12 17:25 by LanceZhang, 3989 visits, 网摘, 收藏, 编辑
摘要: 在网页应用程序的开发中,页面之间的传值应该是最常见的问题了。 在这篇文章里,azamsharp 将为我们介绍一些ASP.NET页面传值的方式。本文所举的例子非常简单,仅仅包含了一个文本框和几个按钮,当按钮点击时文本框中的字符串将会以不同的方式传递到另外的页面去。 阅读全文

关于ASP.NET全球化/本地化(多语言)的一些资源( resource about ASP.NET Localization )

2008-08-12 11:58 by LanceZhang, 329 visits, 网摘, 收藏, 编辑
摘要:Localization Made Easy with ASP.NET 2.0http://www.codeguru.com/csharp/.net/net_asp/miscellaneous/article.php/c12407/Localization in ASP.NET 2.0http://www.ondotnet.com/pub/a/dotnet/2005/08/08/localizin... 阅读全文

获得客户端的时区(get client-side time zone by JS)

2008-08-11 17:06 by LanceZhang, 647 visits, 网摘, 收藏, 编辑
摘要:可以用JS获取,方法如下:注意,getTimezoneOffset()函数以分钟为单位,显示与格林尼治时间相差的数值,所以需要除以60. [代码] 阅读全文

很累很失败,发奋学英语

2008-08-07 18:37 by LanceZhang, 266 visits, 网摘, 收藏, 编辑
摘要:这几天状态很差...一直都知道自己的英语不好,但今天才发现原来糟糕到了如此地步,以至于成为最大的瓶颈今天Review我的post,我发现几乎所有的问题,归根到底,都是因为misunderstanding或者表述不清,或者因为表述不清而产生的其它问题。真的很失败,想想自己在大学时,从没认真上过一节英语课,四级成绩只超过分数线2分,六级没过以后下班不玩了,看英语。。。Sincerely,Lance Z... 阅读全文

三种让网页全屏的方法( three ways to make a full screen page)

2008-08-07 12:09 by LanceZhang, 4059 visits, 网摘, 收藏, 编辑
摘要:最常见的是使用window.open的方法,直接打开全屏网页:[代码]另外,如果想让已经打开的网页全屏,有以下两种方法:1.使用ActiveX[代码]2.使用window.open模拟当前页:[代码] 阅读全文

在网页中使用Winform控件,并调整其大小(using Winform control in ASP.NET and adjust its size)

2008-08-07 11:46 by LanceZhang, 473 visits, 网摘, 收藏, 编辑
摘要:客户难缠,时间紧迫,郁闷ing使用Winform控件的方法还没来的及翻译:http://www.15seconds.com/issue/030610.htmhttp://codebetter.com/blogs/peter.van.ooijen/archive/2007/06/18/including-a-winforms-user-control-in-an-asp-net-web-page.a... 阅读全文

共享一个邮件发送的程序( share a Mail Sending program)

2008-08-06 17:35 by LanceZhang, 283 visits, 网摘, 收藏, 编辑
摘要:写的不怎么好,当时用来测试邮件系统而写的,基本上所有的邮箱,三种类型的邮件都可以发送,还凑合http://files.cnblogs.com/blodfox777/MailSender.rar 阅读全文

ASP.NET 动态创建文本框 TextBox (add TextBox to page dynamically)

2008-08-06 11:03 by LanceZhang, 1356 visits, 网摘, 收藏, 编辑
摘要:ASP.NET 动态创建文本框,并从服务端获取其值 阅读全文

使用Silverlight 2+Deep Zoom 三分钟制作精美电子地图(含代码)

2008-08-05 19:23 by LanceZhang, 4602 visits, 网摘, 收藏, 编辑
摘要:大家用过Google earth或Baidu Map的都知道他们的电子地图可以支持 鼠标拖放、局部缩放等操作,又炫又酷,其原理就是在服务端准备了多个层次大小不同的图片,通过条件选择显示,其工作量大,非常复杂。 而如今,在Silverlight 2下,MS提供了Deep Zoom Composer工具,能够仅仅通过鼠标点击便帮我们生成一个强大的10层电子地图,并连同Silverlight XAML代码 阅读全文

使脚本和CSS在IE8中兼容

2008-08-05 18:19 by LanceZhang, 340 visits, 网摘, 收藏, 编辑

为ASP.NET按钮(Button)添加确认对话框

2008-08-05 18:14 by LanceZhang, 1080 visits, 网摘, 收藏, 编辑

国内外各大邮件网站的POP3和SMTP地址

2008-08-05 17:44 by LanceZhang, 717 visits, 网摘, 收藏, 编辑

打印网页时背景图片的问题

2008-08-05 13:21 by LanceZhang, 1052 visits, 网摘, 收藏, 编辑

JavaScript 验证的几个好资源/文章

2008-08-05 11:44 by LanceZhang, 206 visits, 网摘, 收藏, 编辑

直接下载文件,而非在浏览器中打开

2008-08-05 11:23 by LanceZhang, 298 visits, 网摘, 收藏, 编辑

Outlook样式的Web目录资源汇总

2008-08-04 13:49 by LanceZhang, 616 visits, 网摘, 收藏, 编辑
摘要:HiALLThere are many Outlook style menus, hope this helps:Outlook Style Menu With Collapse Side Menuhttp://www.codeproject.com/KB/aspnet/Outlook_Style_Menu.aspxOutlook Style Menuhttp://www.obout.com/sm... 阅读全文

编程修改IE语言设置

2008-08-04 13:36 by LanceZhang, 1399 visits, 网摘, 收藏, 编辑
摘要:一般我们要修改IE的默认语言,做法是这样的:而这样做实质上就是修改注册表,注册表项为: HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\International\AcceptLanguage如果需要编程实现,只用把这个键值修改一下就行了,比如下图的键值就意味着:IE首选语言为中文,其次为英语 阅读全文

.net创建一个ActiveX控件并使用的简单例子

2008-08-04 12:17 by LanceZhang, 773 visits, 网摘, 收藏, 编辑
摘要:在很多情况下,客户往往需要在客户端实现一些复杂的功能,有些可以通过AJAX来实现,有些则是现有客户端脚本不能完成的,此时则必须通过ActiveX控件来实现。这里给出一个用.net编写简单的ActiveX并在网页中应用的例子:[代码][代码] 阅读全文

.net创建一个ActiveX控件并使用的简单例子

2008-08-04 10:23 by LanceZhang, 364 visits, 网摘, 收藏, 编辑
摘要:在很多情况下,客户往往需要在客户端实现一些复杂的功能,有些可以通过AJAX来实现,有些则是现有客户端脚本不能完成的,此时则必须通过ActiveX控件来实现。这里给出一个用.net编写简单的ActiveX并在网页中应用的例子:[代码][代码] 阅读全文
无觅相关文章插件,快速提升流量