Posts

Showing posts from May, 2007

Am I a Popup?

One way of determining if the current page is a popup or not, is to check the Request.UrlReferrer. If the object is Nothing, it is safe to assume that the page is a popup. However, during subsequent page loads, the UrlReferrer changes - to the active page! One work around is displayed below: If Request.UrlReferrer Is Nothing OrElse Not String.IsNullOrEmpty(Request.Form("__IsPopup")) Then Master.isMenuVisible = False SearchMenu.Visible = False btnBack.OnClientClick = "window.close()" ClientScript.RegisterHiddenField("__IsPopup", True) End If By Registering a HiddenField with a clever name, you can have your page remember that it is a popup window and act accordingly.

Silverlight

Getting started With a seamless integration with the existing .NET framework, clean distinction between UI design and code, I strongly believe this will be a hit. I predict a lot of Silverlight applications or at least applets in a near future. Get on the train!

Modal JavaScript windows

There does not seem to be a unified way of creating a modal window. Web sources have told me that Mozilla and Opera supports a "modal=yes" attribute in it's window.open argument string, whereas Internet Explorer supports an showModal-method. Issues include, however, Mozilla's inability to keep the modal window on top, whereas Internet Explorer's approach disables access to global variables in the opening window, thus limiting the functionality. I have come up with an alternate approach: function OnBlurEventHandler() { window. focus(); if ( window .attachEvent) window .opener.attachEvent("onfocus", OnBlurEventHandler); else if ( window .addEventListener) window .opener.addEventListener("focus", OnBlurEventHandler, false ); } if ( window .attachEvent) window .opener.attachEvent("onfocus", OnBlurEventHandler); else if ( window .addEventListener) window .opener.addEventListener("focus", OnBlurEventHandler, fal

WebDings Web Graphics

Brief list of useful font glyphs that can be used in grid views and what-nots (Caveat: Doesn't work in FireFox 2 ): Glyph Text representation 3 (previous) 3 4 (play / next) 4 7 (rewind) 7 8 (fast forward) 8 9 (previous track / go to beginning) 9 : (next track / go to end) : A more compatible, but less functional (see post date) option is Unicode; see this page I ended up using the ASP.NET browser ID functionality, separating my GridView's Pager implementation for the two browsers like so: <ie:PagerSettings   Mode="NextPreviousFirstLast"   FirstPageText="9" LastPageText=":" NextPageText="4" PreviousPageText="3"   Position="Bottom" /> <ie:PagerStyle   ...   Font-Bold="True"   Font-Names="webdings"   Font-Size="Larger"   HorizontalAlign="Right" /> <mozilla:PagerSettings   Mode="NextPreviousFirstLast"   FirstPageText="&lArr;" Las