posts - 83, comments - 184, trackbacks - 0, articles - 0
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

2011年11月29日

My post test

posted @ 2011-11-29 21:33 a-peng 阅读(12) 评论(0) 编辑

2011年6月10日

当给div加contenteditable="true"来实现inline edit时,在ie下display: none与visibility: hidden的元素会显示出来(这是ie的默认行为),我们可以通过以下脚本修复。

<script type="text/javascript">
window.document.execCommand('RespectVisibilityInDesign', true, true);
</script>

具体可参看:http://msdn.microsoft.com/en-us/library/aa770023%28VS.85%29.aspx

posted @ 2011-06-10 15:09 a-peng 阅读(50) 评论(0) 编辑

2011年3月30日

Associations in EF Code First CTP5: Part 1 – Complex Types


http://weblogs.asp.net/manavi/archive/2010/12/11/entity-association-mapping-with-code-first-part-1-one-to-one-associations.aspx

Associations in EF Code First CTP5: Part 2 – Shared Primary Key Associations


http://weblogs.asp.net/manavi/archive/2010/12/19/entity-association-mapping-with-code-first-one-to-one-shared-primary-key-associations.aspx

Associations in EF Code First CTP5: Part 3 – One-to-One Foreign Key Associations


http://weblogs.asp.net/manavi/archive/2011/01/23/associations-in-ef-code-first-ctp5-part-3-one-to-one-foreign-key-associations.aspx

posted @ 2011-03-30 23:07 a-peng 阅读(81) 评论(0) 编辑

2011年3月23日

1. Url routing
    routes.MapRoute(
                "Default", // Route name
                "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
            );

    http://site.com/ > controller = Home, action = Index

    http://site.com/home/index > controller = Home, action = Index

    http://site.com/home/index/1 > controller = Home, action = Index, id = 1

http://site.com/test > controller = test, action = Index
    使用http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx进行验证

Route Tester

Type in a url in the address bar to see which defined routes match it. A {*catchall} route is added to the list of routes automatically in case none of your routes match.

To generate URLs using routing, supply route values via the query string. example: http://localhost:14230/?id=123

: {controller}/{action}/{id}

Route Data
KeyValue
controller test 
action Index 
id
Data Tokens
KeyValue


All Routes
Matches Current RequestUrlDefaultsConstraintsDataTokens
False Admin/{controller}/{action}/{id} action = Index, id = (null) Namespaces = System.String[], area = Admin, UseNamespaceFallback = False
False {resource}.axd/{*pathInfo} (null) (null) (null)
True {controller}/{action}/{id} controller = Home, action = Index, id = (null) (null)
True {*catchall} (null) (null) (null)


Current Request Info

AppRelativeCurrentExecutionFilePath is the portion of the request that Routing acts on.

AppRelativeCurrentExecutionFilePath: ~/test

RouteDebug.RouteDebugger.RewriteRoutesForTesting(RouteTable.Routes);

posted @ 2011-03-23 14:00 a-peng 阅读(60) 评论(0) 编辑

2011年1月21日

1. Download Windbg

www.windbg.org

2. sos.dll and mscordacwks.dll
sos.dll
--------------------
http://msdn.microsoft.com/zh-cn/library/bb190764(vs.80).aspx
SOS 调试扩展允许您查看有关在公共语言运行库内运行的代码的信息。 例如,可以使用 SOS 调试扩展显示有关托管堆的信息、查找堆损坏情况、显示运行库所使用的内部数据类型以及查看有关在运行库内运行的所有托管代码的信息。帮助您在 WinDbg.exe 调试器和 Visual Studio 中调试托管程序。

mscordacwks.dll
--------------------
http://stackoverflow.com/questions/670725/mscordacwks-dll-and-mscorwks-dll-confusions

mscorwks is the main MS CLR implementation.

mscordacwks provides a data-access abstraction over the CLR details, so that debuggers (such as SOS) don't need to know too much about the internals of mscorwks

3. Command
01010101 指代内存地址

> .load sos.dll
> .load mscordacwks.dll

> !help
> !DumpDomain 列出所有Domain
> !DumpDomain 01010101 列出01010101 Domain的详细信息
> !SaveModule 01010101 C:\Test.dll 将Module 01010101保存成dll可以使用Reflector查看
> !Name2EE * ConsoleApplication1.Program 遍历所有已加载模块,查看ConsoleApplication1.Program类型
> !Name2EE ConsoleApplication1.exe!ConsoleApplication1.Program 从ConsoleApplication1.exe中查看ConsoleApplication1.Program类型
> !DumpMD 010101 查方法
> !DumpClass 010101 查类
> !do 010101  查值

> .time
> !threadpool
> !threads
> ~3s ID为3的线程
> !clrstack 调用堆栈
> !dumpmt -md 010101 查看方法描述符,会有相关调用堆栈

posted @ 2011-01-21 15:59 a-peng 阅读(39) 评论(0) 编辑

2010年2月6日

摘要: Unity三篇好文Unity(1)简介及简单使用http://www.xiaozhou.net/dotnetdevelopment/unity-study-notes-1-unity-introduction-and-easy-to-use-2009-04-23.htmUnity(2)配置文件的使用http://www.xiaozhou.net/dotnetdevelopment/unity-st...阅读全文

posted @ 2010-02-06 16:46 a-peng 阅读(51) 评论(0) 编辑

摘要: http://msdn.microsoft.com/en-us/library/8kb3ddd4.aspxLocalize Eval dataEval只有这两种重载,没有涉及到本地化。protected internal object Eval(string expression);protected internal string Eval(string expression, string f...阅读全文

posted @ 2010-02-06 16:45 a-peng 阅读(35) 评论(0) 编辑

摘要: 博客左边的存档相信大家都很常见到吧。我写了句sql语句,希望取出年份,月份,记录数。[代码]然后我希望在Entity Framework里实现,我用Entity SQL实现了下。[代码]生成SQL语句[代码]如果按上面的思路用linq表达式发现要group by两次,貌似很复杂。换个算法。代码Code highlighting produced by Actipro CodeHighlighter...阅读全文

posted @ 2010-02-06 16:44 a-peng 阅读(316) 评论(0) 编辑

摘要: Application Start应用程序启动后,会获取一个应用实例ApplicationInstance通过HttpApplicationFactory.GetNormalApplicationInstance方法获取,在该方法中会调用InitModules初始化所有Modules,然后会调用一个Init方法。我们可以覆盖这个Init方法来初始化一些数据。等级和InitModule中的Init一...阅读全文

posted @ 2010-02-06 16:43 a-peng 阅读(25) 评论(0) 编辑

摘要: 无意间发现一个问题。1、输入: http://demo/admin2、被重定向到: http://demo/user/login  正常3、登录完成回到: http://demo/admin4、退出完成回到: http://demo  正常5、输入: http://demo/admin 既然正常显示。。。不会被重定向到http://demo/user/login我在AdminBasePage里的代...阅读全文

posted @ 2010-02-06 16:42 a-peng 阅读(45) 评论(0) 编辑