• Pro-Tip: How To Stop/Start Background Streaming Audio In Windows 8

    In my spare time, I've been working on a little online radio streaming app for Windows 8, based on the sample project from Microsoft. What I very quickly discovered was that calling .Stop() and .Pause() on MediaElements that were reading from streams didn't actually do anything. My first cut at a solution was to set the MediaElement's source to null, and then recreate the source in lieu of Stop / … more

  • It Turns Out It's Really Easy To Scam People

    If you use their second language :( Yup, I fell victim to a scam / phishing thing today...terrible timing too, very busy day at work, already had plans for tomorrow, can't move the work, and then bam a pile of steaming fraud to deal with... Moral of the story: even if it is from your uncle (whose account has been hacked and you don't know yet), if he's registering for anything and doesn't tell … more

  • Configuring Tracing For A Windows Azure Role

    Aaaah! I can't believe how long this took me to work out :( It doesn't really help that the information is spread around a billion different pieces on MSDN and what not. But enough excuses! Here's what I think the steps are (and because I clearly am not a genius, feel free to improve this instruction set) What we want Tracing (ie calls to System.Diagnostics.Trace.WriteInformation("hello") to be … more

  • Adorable Chinese Etymology - Teeth (齒)

    I'm nearing the 1000 character mark on Skritter (maybe I'll hit it before the end of the month? Progress is slow but steady), and here's one that like 龜 has a pretty direct relationship to its pictorial past - 齒. Essentially, it's a mouth with teeth - simple as that! I've just come back from Kaoshiung where I partook in the age old tradition of roadside barbecue in celebration of the Mid-Autumn / … more

  • ASP.NET Javascript DoPostBack and SharePoint: Single Postback Issue

    Here's a quick tip (man, there sure has been a lot of SharePoint in my last few posts!) If you've got a Sharepoint page, and normal postbacks (like paging in your SPGridView or LinkButtons) stop working after you use a __doPostBack() javascript command, try adding the two settings just before your postback: _spFormOnSubmitCalled = false; _spSuppressFormOnSubmitWrapper=true; __doPostBack(' … more

  • Using SPGridView With DataPager (For Nicer Pagination)

    Surprise, surprise - another post about SPGridView. This time, we're looking at how to use the nice .NET 3.5 DataPager control with SPGridView. Out of the box, they don't work together (for the same reason GridView and DataPager don't), because SPGridView doesn't implement the IPageableItemContainer interface, which the DataPager expects. Lucky for us, someone's already done all the hard work … more

  • SPGridView Deep Dive: Custom Filter Menu Values

    Over the last few days, I've learnt far more about SPGridView than I'd ever wanted to know, and here's a gnarly case I worked out and thought I'd share the knowledge! As a base, I'm hoping you've set up a fully functioning SPGridView with custom sort and paging - that's covered via a combination of my previous blog posts on SPGridViews and maybe this guide to the ObjectDataSource itself. If you' … more

  • Pro-Tip: jQuery Event Binding and ASP.NET UpdatePanels

    If you've bound some events (like a keypress to a textbox) within an ASP.NET update panel, this will work the first you try it, but not on subsequent times. Why? Well, as part of its operation, the ASP.NET UpdatePanel replaces the entire html content of the panel, invalidating your bound events. Fortunately, you can instruct ASP.NET to bind subsequent events with the PageRequestManager, while … more

  • Gotcha: ListView Control Only Paging Once (a.k.a How Did We Get Work Done Before The Internet)

    Here's the scenario: I had a ListView control in a Visual Web Part running in SharePoint 2010 with a script manager on the page - but my List View would only display correctly on page load, and after one paging command, then no longer. With the power of the internet, I came across a very similar situation and resolution online. It turns out that while I checked everything in the ASP.NET … more

  • Strong Naming Assemblies For Sharepoint Part 2: Updating Specific Version References

    Without access to the source code for assemblies, you can add sign / add strong names for them for use in SharePoint via ildasm and ilasm (for which the instructions I previously wrote about). However, consider the scenario where: Assembly A (unsigned) has a reference to a specific version of Assembly B (also unsigned). I tried going the regular ilasm route, but Visual Studio kept complaining … more

  • SPGridView Gotcha #2: Performance Issues / DataBinding multiple times

    Going off my previous SPGridView post a few days ago, I ramped up the testing for the SPGridView to grab some data from a live service hosted online somewhere. However, the performance for the SPGridView was terrible - it took somewhere within the range of 5-6 seconds to switch between pages of 10 items. Busting out the ULS logging and debugging tools, it turns out the Select method on the … more

  • WCF: Generic Errors, Tracing And You

    Working on some RESTful WCF services, I've on occasion noticed the totally unhelpful and blank "the connection was reset" errors when calling some of my method calls. At the time, I was testing returning very large data sets so I had a suspicion I was probably hitting a limit in WCF somewhere; but hitting the service through the browser wasn't being particularly helpful. I'd already included the … more

  • Quarter Life Club

    Okay, so maybe assuming I will live to 100 is a little presumptuous. But still - I turn 25 today, and it's a very thought provoking milestone. When I was born, back in 1987: Final Fantasy I was released The Berlin Wall still separated East and West Germany Microsoft released Windows 2.0 Now, in 2012: We're up to Final Fantasy XIV Germany is reunited, but Korea isn't Windows 8 is slated to … more

  • SPGridView Gotcha: Filtering, ObjectDataSource and You

    Giving the SPGridView a good kick around today, seeing if it'll fit the bill for our development work - I came across two really great resources which I highly recommend for anyone looking to get a SPGridView up and going: Erik Burger's blogposts, Part 1 and Part 2 Kit Menke's note on potential filtering bugs with data that contains apostrophes So following those posts, I got my SPGridView up … more

  • Ibon: How To Print Documents at 7-11 In Taipei (100% Online)

    Need to print a ticket, document or something else? While it's not particularly English friendly, it turns out that you can actually print any Word document or PDF at any 7-11 store in Taipei using their ibon machines! Defying logic, the upload and printing options aren't documented under the print section of the website or on the machine itself. But the gist of it is: Step 1) Upload your file … more

  • WCF + Entity Framework + JSON = Tears

    Well, maybe not tears, but it probably won't work as smoothly as you want it to right out of the box. I had my nice little WCF with JSON responses all going nicely, with some test data, and that was all sweet, but the second I tried to return an EF object, WCF cried miserable, miserable tears and didn't return anything. What's the deal? It turns out that the JSON serializer doesn't like the " … more

  • Here's Two Adorable Chinese Words

    Over dinner, my aunt taught me two words which I thought had particularly accurate radical compositions: The word for 'heating up' / 'burn/scald/hot' is: 湯 (tang2, soup) + 火 (huo3, fire) = 燙 (tang4) The word for 'blind / unseeing' is 亡 (wang2, die/perished) + 目 (mu4, eye) = 盲 (mang2) Excellent, excellent! more

  • Signing Compiled Assemblies To Meet Sharepoint's Strong Name Requirements

    Recently been working on some SharePoint stuff which required using a few external libraries - and as you may well know, SharePoint requires you to have strong named assemblies (ie, signed) for them to be deployed to the GAC. So what happens if you're given a compiled .dll, but not the source? Turns out that with a bit of command line / dev tool magic, you can decompile and recompile (with key) … more

  • Taipei, 7-11 Heaven

    There are a very, very large number of convenience stores here in Taipei - just about every street and streetcorner will have two or three, and the major chains are OK Mart, FamilyMart, Hi-Life and the world famous 7-11. 7-11 is a little unique in that you can also do a lot of things there that aren't immediately obvious, such as pay your power bill. I found their Chinese site rather hard to … more

  • SharePoint 2010 - Closing A Modal Dialog Within An UpdatePanel Programmatically

    SharePoint 2010 provides lots of nice of JavaScript helpers and methods, one category of which involves Modal Dialogs (eg the default behaviour when you view / edit a list item in a list). We can pretty easily create a modal dialog with a call to SP.UI.ModalDialog.showModalDialog(options) (and you can take a look at this blog post for a little more detail). So, let's imagine we open a dialog … more