c#

about c#

ASTreeView 1.5.2 Release Notes

ASTreeView has been updated to version 1.5.2, the main BIG improvement is that a new NodeType – TextNode has been added. With TextNode, you can set two links in one node which is not possible in previous versions. Even javascript can be the content of the nodes in a TextNode. New Features: 1. TextNode type is added. The content of tree nodes is now more flexible. You can add html, javascript in the new node type – TextNode: Please visit the online demo. 2. Added EnableDragDropOnIcon...

IE在ssl下CacheControl问题

今天碰到一个问题,IE在ssl(https)环境下,下载文件,会出现如下错误信息: “Internet Explorer was not able to open this Internet site. The requested site is either unavailable or cannot be found. Please try again later.” 查了一下KB (http://support.microsoft.com/default.aspx?scid=KB;EN-US;q316431&),原来是IE的一个bug,在2007年的时候已经有了,但微软到现在还没修复,唉~ 原因大致是这样的: 在ssl下,ie强制no-cache,如果no-cache已经在header里存在了,那么ie就不缓存文件了,所以文件找不到。(好莫名的说法啊) 尝试在下载页面里设置Response.CacheControl, 没有效果。最后,索性调用Response.ClearHeaders();,把Header全部清空,然后再设置Content-Type等属性,问题解决。

ASTreeView 1.4.0 Release Notes

ASTreeView has been updated to version 1.4.0, you may download at http://www.astreeview.com/download/astreeview-1.4.0.zip New Features:   1. Virtical Drag and Drop Nodes     If you use ASTreeView as a list, you can set EnableHorizontalLock=true, then the end user can only move the nodes up and down, not left or right, screenshot:           Visit online demo.   2. Fixed Drag and Drop depth     If you want the end user just move the node within the same level as its original level, you may...

Documentation for ASTreeView

A documentation is now available for ASTreeView. Please visit: http://www.astreeview.com/doc/

ASTreeView 1.3.0 Release Notes

Just back from a trip to Santorini, Barcelona and Athens. :) More photos at: http://www.jinweijie.com/europetrip2009 Back to the topic, the ASTreeView has been updated to 1.3.0, you may download at http://astreeview.googlecode.com/files/astreeview-1.3.0.zip  New Features: 1. Html as TreeNodeText supported.     In the new version, you may use html as tree node text, not only plain text. 2. Support escape edit/add input.      Set the EnableEscapeInput property to enable this feature, default is true. 3.Multiline Edit Mode supported.    Set the EnableMultiLineEdit...

ASTreeView 1.2.2 Release Notes

ASTreeView 1.2.2 released. You may download it now from: http://astreeview.googlecode.com/files/astreeview-1.2.2.zip Here is a list of the new features added and bugs fixed: New Features: 1. Themes     ASTreeView now supports themes! Developer can easily create his own theme for the treeview. Check out the demo.     2. Right-To-Left support     ASTreeView now supports rtl display, thank Mojtaba Vali for the suggestion! Also check out the demo.     3. A performance testing...

ASTreeView 1.1.2 What’s New

I registered a domain for ASTreeView: www.astreeview.com This domain will be only used for ASTreeView, updates, demos, blogs. It can be regarded as the official site. :D I release ASTreeView 1.1.2 just now. It can be download from: http://astreeview.googlecode.com/files/astreeview-1.1.2.zip online sample: http://www.astreeview.com added two new features: 1. Extending ContextMenu     Now it is possible to add your customized ContextMenu Items to the menu. A screenshot:             Online demo: http://www.astreeview.com/astreeviewdemo/ASTreeViewDemo3.aspx      To add your customized menu, it’s easy: ...

ASTreeView 1.1.1 Released

I got many feedbacks since the 1.0 release of ASTreeView. Thanks guys for your support! You can download it now from: http://astreeview.googlecode.com/files/astreeview1.1.1.zip If you want a sample for connecting sql server, you can also download the sample: http://astreeview.googlecode.com/files/astreeview1.1.1_sql_server.zip   The new version of ASTreeView includes:   Some bugs fixed: In DropdownTreeView, the RequiredValidator cannot be disabled. Javascript error when ajax request failed. Tree line does not display correctly after move the last node. Initialization of the treeview...

ASTreeView: Resolve confliction with jQuery

Thanks xiaot for reporting this issue that if jQuery is included in page, it conflicts with the ASTreeView. To resolve this issue, we can use the noconflict method of the jQuery: <script src="jquery-1.3.2.js"></script> <script type="text/javascript"> var J = jQuery.noConflict(); </script> Now $("#foo") will be J("#foo") and it will not conflict with the ASTreeView. I’ll update the ASTreeView internal methods, make it not conflict with jQuery in the next version. updated The new version (1.1.1) does not conflict with jQuery any more, please update if you’re...

ASTreeView 1.0 Released

ASTreeView is a powerful treeview with drag drop, ajax loading, context menu, xml import/export, checkbox, selection, add/editing/deleting nodes with ajax. This is version 1.0.[Read More...]

生成指定长度的随机字符串

有时候在测试代码的时候,想生成一些随机的字符串,写了点代码,可以生成指定长度的字符,范围是a-z,如需增加范围,只需修改第七行即可。 代码如下:[Read More...]

xpath不区分大小写写法

前段时间做项目的时候碰到一个问题,因为是用xml作为数据原,在处理用户名的时候不需要区分大小写,写xpath的时候碰到如何不区分大小写的问题。比如,用户名为Ryan和用户名为ryan其实是同一个用户。 最终还是解决了,其实就是用translate把字符全部转为大写再比较。 代码如下:[Read More...]

xslt转换示例xml xslt transform using c#

在以前公司的时候写过一点用c#通过xslt把xml转成html的代码,在此记录一下,附示例xml和xslt。 主要是用MemoryStream把xml先载入,并不复杂。[...]

小算法 - 将一个字符串分割成等长的几段

将一个string分成等长的几分 例如,SplitStringIntoMultipart( "abcdefgh", 3 ); 会返回 "abc", "def", "gh"   public static string[] SplitStringIntoMultipart( string input , int eachCount )   {       if( input.Length == 0 )           return new string[0];       if( input.Length <= eachCount )           return new string[1]{input};       int partNum;       if( input.Length % eachCount == 0 )           partNum = input.Length / eachCount;       else           partNum = input.Length / eachCount + 1;           string[] result = new string[partNum];       for( int i = 0; i < partNum - 1; i++ )           result[i] = input.Substring( i * eachCount, eachCount);          result[partNum-1] = input.Substring( ( partNum - 1 ) * eachCount );       return result;   }   public static string[] SplitStringIntoMultipart( string input , int eachCount ) { if( input.Length == 0 ) return new...

用JavaScript执行PostBack

早上实现了在子页面更新数据以后,父页面刷新树的功能 思路: 父页面有个隐藏的html button作为proxy,子页面保存完数据以后,用js调用父页面的html button的触发函数click(); 父页面有个asp.net的link button控件,text="",等于也是隐藏的,它负责调用后台cs代码里的负责刷新树的方法; 父页面的html button onclick的时候,__doPostBack('DoRefresh',''); 代码: 父页面apsx:  <input type="button" id="DoRefreshProxy" value="DO" onclick="__doPostBack('DoRefresh','');" style="display:none;" />  <asp:linkbutton id="DoRefresh" runat="server" onclick="DoRefresh_Click"  CausesValidation=False/>  <input type="button" id="DoRefreshProxy" value="DO" onclick="__doPostBack('DoRefresh','');" style="display:none;" /> 父页面cs:  protected void DoRefresh_Click(object sender, EventArgs e)  {       this.BindTree(this.tvBuilding.SelectedNodeIndex,1);  }  protected void DoRefresh_Click(object sender, EventArgs e) { this.BindTree(this.tvBuilding.SelectedNodeIndex,1); } 子页面cs:  Page.RegisterStartupScript("pb","<script>window.opener.document.getElementById('DoRefreshProxy').click();</script>");  Page.RegisterStartupScript("pb","<script>window.opener.document.getElementById('DoRefreshProxy').click();");

Full c# Archive

View posts by date
«March»
SunMonTueWedThuFriSat
28123456
78910111213
14151617181920
21222324252627
28293031123
45678910