Contents tagged with

  • 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

  • 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

  • Using the DefaultButton property on asp:Panel controls with LinkButtons

    When building a site, if you've got multiple input forms and buttons (such as a global search in a header and a contact us form as part of the page content), hitting the enter button on any part of the form normally defaults to submitting the very first form on the page (in the example, the search in the header). To get around this, all you need to do is set the DefaultButton property on a asp: … more

  • ASP.NET DropDownList and optgroup

    It's been a bit quiet in here, but here's a short and sharp tip - for some reason (backwards compatibility, most likely), the standard DropDownList control doesn't support adding <optgroup> elements in order to nicely group your list item options. There's lots of workarounds for this (roll your own "dropdown" with jQuery, insert some dummy list items and bold them etc) but the best way is … more

  • I Am Now An ASP.NET 3.5 Tech Specialist

    Or, how not to design your elevators... At work, there is a voucher floating around for five free Microsoft Exams (well, by free I mean work had already paid for the voucher and nobody was taking it). So in an act of extreme bravery and stupidity, I decided that I would use this voucher. This was about a week ago - and I just sat and passed one of the exams. Keeping in mind that the last time I … more

  • 1