09 2012 档案
摘要:<!DOCTYPE html><html><head> <style> body{ background: url(index.gif) repeat fixed top;} </style></head></html>-------------------Here is the image index.gif----------------
阅读全文
摘要:Refer to http://zhidao.baidu.com/question/129465844.html&__bd_tkn__=26bf1e352b05802a4a14e964a08a27ae8d14dfeb8078338d51fed8133ea5c69d362ad36bb4bcda3b39bb3949f6bbe47087ac3af56e60b1f4e7eb6015795ef4369b62a1fc5a0f03de0125270fd43bca7a4f76e8757f29c384d73d357e725c475dbf6102414ec5d9dee97efbaccbdc8d03c33d
阅读全文
摘要:You can share views between controllers by putting them into the Views/Shared folder. Each controller can then render that view by name.You can render a partial view (which can be shared between controllers as in (1)) within the current view using Html.Partial().You can use Html.Action() to invoke a
阅读全文
摘要:Refer to http://www.em64t.net/2010/12/razor-html-renderpartial-vs-html-partial-html-renderaction-vs-html-action-what-one-should-use/Html.RenderAction VS Html.ActionThe difference between the two is that Html.RenderAction will render the result directly to the Response (which is more efficient if the
阅读全文
摘要:Refer to http://stackoverflow.com/questions/31044/is-there-an-exists-function-for-jqueryjQuery.fn.exists =function(){returnthis.length>0;}if($(selector).exists()){ // Do something}
阅读全文
摘要:Jquery dialog UI refer to http://blog.nemikor.com/2009/04/08/basic-usage-of-the-jquery-ui-dialog/1. Create a httphandler (New Item -> Generic httphanler)namespace TstOpenDialog_SevCallCliScri{ public class DialogMessageHandler : IHttpHandler { public void ProcessRequest(HttpContext cont...
阅读全文
摘要:1. Add following into web.config. <system.web> <httpModules> <add name="CustomAuthorizationModule" type="TstHttpModule.CustomAuthorizationModule" /> </httpModules>2. Create a class into appdata folder2.1 Session is not null for the first time.2.2 OnAcquire
阅读全文
摘要:Refer to http://stackoverflow.com/questions/844362/how-to-custom-theme-jquery-ui-tabs-not-using-themeroller<!DOCTYPE html><html><head> <title>LoginPage</title> <script type="text/javascript" src="http://www.cnblogs.com/Scripts/jquery-1.8.2.min.js"
阅读全文
摘要:Same:1. Both clustered and nonclustered indexes can be made up of more than one column.2. Both clustered indexes, and nonclustered indexes take up additional disk space.3. Adding indexes (both clustered and nonclusterd) will increase the amount of time that your INSERT, UPDATE and DELETE statement t
阅读全文
摘要:1. Create and delete clustered indexDrop Index PerformanceIssue.UNC_PRIDCREATE UNIQUE NONCLUSTERED INDEX UNC_PRID ON PerformanceIssue (PRID)CREATE UNIQUE CLUSTERED INDEX UC_PRCode ON PerformanceIssue(PRCode)2. Refer to http://www.blogjava.net/jiabao/archive/2008/04/08/191595.html2.1 【Table Scan】 打开执
阅读全文
摘要:1. In technical terms, a table without an index is called a “heap”.2. Common functions.select db_id(N'Product'); -- Get DB idselect object_id('test.dbo.PerformanceIssue') -- Get Table idselect * from sysobjects where id= object_id('PerformanceIssue') and type = 'U' --
阅读全文
摘要:<script type="text/javascript"> $(document).ready(function () { $("#validimg").click(function () { $("#validimg").attr('src', '@Url.Content("~/Home/GenerateImage?")' + Math.random()); }); }) </script> <div> <img alt="验
阅读全文
摘要:Create a new folderOpen Visual StudioChoose "File" -> "Open web site"Go to the recently created folderThen right click -> Add New itemSelect "HTML File"Rename the file as .ASPCreate a new web site or virtual directory in IIS and point to the folder 1. Open 'Ad
阅读全文
摘要:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Refer to http://www.
阅读全文
摘要:public void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", // Route name "{controller}/{action}/{id}", // URL w/ params new { controller="Home",...
阅读全文
摘要:Refer to http://s.yanghao.org/program/viewdetail.php?i=25618在服务端维护登录用户与其SessionID的关系。同一用户,后登陆者将前登陆者的SessionID冲掉,这样,前者如果再请求服务器资源,就会认为 其未登录,要求重新登录。这样,即使出现断电等无法注销的情况,也会在他下次登陆时自动取代掉,同时也解决了用户登陆的唯一性问题。
阅读全文
摘要:Add dynamic-update="true" in configuration file on the class level node<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection">
阅读全文
摘要:Refer to http://www.cnblogs.com/tyb1222/archive/2012/06/18/NHibernate-Inverse-Cascade.html由测试六、测试七可知:对于删除与父类之间的关系时,all-delete-orphan会将孤儿删除(orphan意为:孤儿),而all不会删除,而是将与父关联的外键字段设置为null。
阅读全文
摘要:WCF doesn't support static method by design.Refer to http://www.codeproject.com/Articles/89858/WCF-Concurrency-Single-Multiple-and-Reentrant-andmaxConcurrentCalls - Calls in excess of the limit are queued. refer to msdn http://msdn.microsoft.com/en-us/library/ms731379.aspx
阅读全文
摘要:Refer to http://stackoverflow.com/questions/97197/what-is-the-n1-selects-problemRefer to http://www.realsolve.co.uk/site/tech/hib-tip-pitfall.php?name=why-lazyProblem:Suppose we have a class Leaf with a many-to-one relationship with Tree. In other words, one Tree can be related to many Leafs. Lets s
阅读全文
摘要:<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Course" table="Course"> <id name="
阅读全文
摘要:<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Staff" table="Staff"> <id name="I
阅读全文
摘要:<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Tree" table="Tree"> <id name="Id&
阅读全文
摘要:<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Cup" table="Cup"> <id name="Id&qu
阅读全文
摘要:<?xml version="1.0" encoding="utf-8" ?><hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" namespace="TstDBConnection.Entities" assembly="TstDBConnection"> <class name="Product" table="Product"> <id name=&qu
阅读全文
摘要:Refer to http://www.cnblogs.com/liubiaocai/archive/2011/09/12/2173991.html1、NH的延迟加载的意思就是:你访问了属性(就是点一个属性出来,除了ID之外)就生成sql到数据库加载2、NH的在延迟加载有2个方面,一个是延迟加载类的;另外一个是延迟加载集合的3、NH的类延迟加载仅对于使用session的Load方法时才有效【如果使用Get的话,不管类级别的lazy怎么配置,始终会生成一条加载类本身的sql】4、NH的集合延迟加载,对于session的Get和Load方法都是有效的5、如果把类级别的lazy设置为false,那么
阅读全文
摘要:Refer to http://www.cnblogs.com/netgarden/archive/2006/11/23/570129.htmlEvery data access strategy after server-side cursors has had as a goal minimizing the length of time an application holds open a connection, and NHibernate is no different. Therefore, having a static Session sitting around open
阅读全文
摘要:Refer to http://stackoverflow.com/questions/785413/difference-between-httpcontext-current-and-controller-context-in-mvc-asp-netThe context provided by the controller (not the static HttpContext.Current) is mockable. If you're interested in unit-testing your code, it's generally far easier to
阅读全文
摘要:Refer to http://stackoverflow.com/questions/814206/getting-db-connection-through-singleton-classYou won't be able to open multiple SqlDataReaders/Commands with the connection at the same time and will run into thread blocking issues if you are trying to share the same connection object with mult
阅读全文
摘要:Refer to http://blog.163.com/xhy_cy/blog/static/1049762320112305016599/ private readonly string connectionString; // only can be initializable once private static object syncRoot = new Object();//为了解决多线程,而添加的一个附加变量,以避免死锁 public static SConnection Instance{ get{ if (insta...
阅读全文
浙公网安备 33010602011771号