肖恩D++
Not Equal C && !=C && C && 不等于西-
MVC3 with IIS7 credential error
Posted on March 19th, 2012 Add commentsWhen I deploy my new MVC 3 project to a Windows 2008 R2 with IIS 7 server, I got an error with “401 – Unauthorized: Access is denied due to invalid credentials” on every page.
After some google’s, I figure out the reason was: in my “_layout” page, I have the code “@Html.RenderAction(…)”, and the action I was trying to render actually is under “Home” controller with “[Authorize]” attribute. In another word, when IIS calling MVC pages, ASP.NET will ask for authentication, and if not authenticated, it’s supposed to redirect to “_logon” page, but unfortunately the “_logon” page (which is using “_layout” as master page of cause) also asked for authentication because of rendering action. It became to a dead end.
Based on the reason explained above, the fastest solution is remove the “[Authorize]” attribute from the controller. But if you don’t want change your code, go to IIS management tool, select the website your are running, choose “Error Pages”, and “Edit Feature Settings”, change “Error Responses” to “Detailed errors”.
5 views -
SyntaxHighlighter language “brush” list
Posted on March 10th, 2012 Add commentsSeems like code highlighter will be very useful, but sometimes it’s hard to remember all “brushes” and their “aliases”. Save to here just for my own records.
Brush Name Brush Aliases ActionScript3 as3, actionscript3 Bash/shell bash, shell ColdFusion cf, coldfusion C# c-sharp, csharp C++ cpp, c CSS css Delphi delphi, pas, pascal Diff diff, patch Erlang erl, erlang Groovy groovy JavaScript js, jscript, javascript Java java JavaFX jfx, javafx Perl perl, pl PHP php Plain Text plain, text PowerShell ps, powershell Python py, python Ruby rails, ror, ruby Scala scala SQL sql Visual Basic vb, vbnet XML xml, xhtml, xslt, html, xhtml
1 views -
最特别的求婚
Posted on February 28th, 2012 Add comments
4 views -
搬家完成
Posted on February 18th, 2012 Add comments最近需要.NET环境的hosting,本想直接在1and1升级,碰巧看到costco和Godaddy合作推出hosting套餐,感觉不错,旋即决定开始实施。
搬家的第一步是要转domain,首先要在目前的register(譬如我的情况就是1and1)把domain变成unlock,然后在新的register提申请(我的情况就是Godaddy),大概1周左右就可以完成转移的过程。然后再去以前的register取消合同就可以了。
接下来就是搬数据库,基本上比较简单,无非就是export和import。
最后就是搬文件和修改设置,这一步比较复杂,因为所有的数据库connection string都要重新改,所有的文件结构都有变化。不过有点耐心,慢慢来也就小菜一碟了。
全部完成后就上来铺一帖,感觉似乎有点慢,莫非Windows的IIS真的就不如Linux好吗?
15 views -
补胎记
Posted on January 26th, 2012 2 comments昨晚,挠人的轮胎报警灯又亮了。在经历了一次又一次狼来了之后,还是决定检查一下看看到底是因为胎压不稳还是轮胎真有问题。撅着腚趴在地上一个轮子一个轮子检查之后,狼真来了:一根直径大概半厘米的铁钉很不识相的嵌在轮胎的胎纹里。郁闷半天之后,决定第二天一早去补胎。
早就知道家附近就有一个叫“America Tires”的轮胎店,虽然从来没进过。店员都还很亲切,简直有点肉麻,让我“噗通,噗通”乱跳的小心脏又增加了几分紧张,要知道服务往往是和价钱挂钩的。
在一番检查之后,技工把车开进车间里修理。大约半个多小时后,接待我的店员递给我钥匙和一张收据,说道:“Sir, you are all set. have a nice day!”
开车赶向办公室的途中,在苦思冥想了半天总觉得“忘了什么事儿”后,终于意识到,原来这次补胎竟然不用给钱……
76 views
0 guests, 5 bots, 0 members
Max visitors today: 8 at 01:20 am PDT
This month: 13 at 05-05-2012 08:55 pm PDT
This year: 54 at 02-28-2012 11:42 pm PST
All time: 102 at 01-17-2011 05:47 am PST







Recent Comments