Month: October 2013
Usefull Open Waves snippets
When Condition is false, the markup (and method calls) inside <ThenContent> is not evaluated.
<ow:ConditionalPlaceHolder runat="server" Condition="<%# CurrentBlock.IsShowAllLinkVisible %>"> <ThenContent> <a href="<%# CurrentBlock.GetCalendarListLink() %>" class="link-big special icon-big-square-right"><%# CurrentBlock.CalendarListText %></a> </ThenContent> <ElseContent> <p>ElseContent</p> </ElseContent> </ow:ConditionalPlaceHolder>
Attach to process – usprawnienie dla Visual Studio
Dodatek do Visual Studio który automatyzuje prostą ale niestety zajmującą wiele klikania czynność. DEBUG->Attach to process i wybieranie tego właściwego spośród listy wszystkich procesów.
Po zainstalowaniu dostajemy kilka nowych opcji.
Feedback after academy
I had an Academy today. It’s a time when anybody from company can have a presentation on any topic. I had a presentation about EPiServer 7 (MVC) development.
I want to point the feedback I get to not forget it for the next Academy:
- I could focus on less topics, but cover them more deeply with more examples
- It was too much chaotic, I was not following a plan (there was no strict plan, let’s say). And it would be difficult to make the same presentation again.
Fill CurrentPage after PostBack in MVC
public class PageContextActionFilter : IResultFilter { private readonly IContentLoader _contentLoader; public PageContextActionFilter(IContentLoader contentLoader) { _contentLoader = contentLoader; } public void OnResultExecuting(ResultExecutingContext filterContext) { var model = filterContext.Controller.ViewData.Model as IPageViewModel<StandardPage>; if (model == null) return; // code like in Alloy Template // When ViewModel is posted back to server by POST, CurrentPage is null, so its set here if (model.CurrentPage == null) { var pageReferene = filterContext.RequestContext.GetContentLink(); var concreteModel = model as PageViewModel<StandardPage>; if (concreteModel != null) { var currentPage = _contentLoader.Get<StandardPage>(pageReferene); concreteModel.CurrentPage = currentPage; } } } public void OnResultExecuted(ResultExecutedContext filterContext) { } }
Screen Capture and instant publish on the web – Jing
I use Jing (nice video on home page) for taking a screenshot (it out of the box uploads it on the web) and pasting url into an excel file, when I needed to make an estimation of rewriting website that is currently running. It’s free.
Jing is developed by TechSmith, the company which is developing Camtasia Studio. I like them 🙂
ASP.NET: skąd ten dziwny kod w przeglądarce? WTF?
Znalazłem w repozytorium commit o enigmatycznej treści WTF. W tym commicie jedyna zmiana to spacja w pustej linijce. Rzeczywiście WTF oddaje zdziwienie developera w momencie gdy to commitował (i mu to pomogło, bo by nie commitował).
Chodzi o to że ASP.NET czasem cache’uje i wisi na starszej wersji pliku widoku (*.aspx, *.ascx, *.cshtml). Nie powinno się tak dziać, ale jednak tak bywa. (Ta funkcjonalność to chyba ASP.NET Dynamic Compilation, jest ona poza tematem wpisu)
Moje najszybsze rozwiązanie
Najszybsze rozwiązanie to ta wymieniona spacja i zapisanie pliku. Zaraz po tym polecam od razu zrobić Ctrl+Z i jeszcze raz zachować – takie spacje nieczyszczone od razu lądują potem w repozytorium.
Można wykonać C:\>iisreset
, można też wyczyścić Temporary ASP.NET files.
Windows 8: restart, hibernate from command line
- Close: shutdown /s
- Restart: shutdown /r
- Hibernate: shutdown /h /f
Instead of using mouse and gesture (which is sometimes tricky inside Virtual Machine), like here: