Sunday, October 11, 2009

SPContext in HTTP Module

Got the 'System.InvalidOperationException' when accessing SPContext in your HTTP Module? To solve this, make sure you attach your eventhandler to the application.PreRequestHandlerExecute event instead of the application.BeginRequest event.

Thursday, July 30, 2009

How To: Extend Telerik RadEditor FlashManager with FLV Player

As you maybe know, the full-featured version of the Telerik RadEditor is able to use flash objects (.SWF files). Customers like this feature, especially in a WCM environment. However, some customers feel the need to play .FLV files into the RadEditor. Since this isn’t supported by Telerik, we have to build it ourself.


Below I’ll guide you through the steps necessary to extend the FlashManager Dialog.


TRadEditor_ToolBar


Preparation


Download (buy) the full featured-version of Telerik RadEditor (at the moment of writing the latest version is 5.5)


I noticed that the HTML field control strips out OBJECT tags. For this reason, place the Telerik RadEditor on top of a NOTE field.


Download and upload a FLV player into your SharePoint environment ( Style Library, Layouts folder, …). You can download the player here.


Extend the Telerik RadEditor


Once you are done with the preparation you can start with the real work…

Extend the configfile.xml with the following properties:


TRadEditor_ConfigXml

Download the Telerik AJAX RadControls sourcecode (I think this is only possible if you have a developer license). There you’ll find a usercontrol, named FlashManager.ascx. Copy this file into the /_layouts/[ProjectName]/RadEditor/EditorDialogs/ folder. Note: This path is equal to the ExternalDialogsPath value available in the configfile.


Open the FlashManager.ascx and search for the _getParams method. In this method you can write all your FLV magic. The code below is just a snippet.


TRadEditor_FlashJavaScript

Now we are able to select, set parameters and place a FLV player into our editor.


TRadEditor_Properties


TRadEditor_EditMode


If you find any difficulties with the implementation of a FLV player… feel free to make a comment or contact the Telerik RadEditor Team.

Saturday, July 18, 2009

Some cool stuff in InfoPath 2010!

Looks like we will use InfoPath 2010 a bit more in our daily SharePoint development... Using it, you now can customize SharePoint list forms by modifying the layout, create views, adding validation, etc...

In InfoPath 2010, we’ve made some big investments to make it much easier to build rich forms-based applications on top of the SharePoint Server 2010 platform.

For more info read - What's new in InfoPath 2010?

Wednesday, June 24, 2009

Is it time to B!ng?

Custom Document Library Item check-in throws error

I got the miserable "Value does not fall within the expected range" error after checking in an item in my newly created custom document library with a custom content type.

Since the cause of the error "Didn't fall within my knowledge range" I had to google ... and *bing!* found what I was looking for.

Lesson learned: Do not set the "required" attribute to true in your content type definition.

Wednesday, May 27, 2009

Accessibility: Empty text alternatives for ASP.NET image control

While building an accessible website you need to take into account that the following elements must have an ALT attribute:
  • img
  • area
  • input with type="image"
Why we need it?

The ALT attribute is designed to be an alternative text description for images.

What are the benefits?
  • Enhance the browsing experience of visitors with disabilities.
  • If somehow the image is not able to load, then a visitor will see the description of ALT attribute. This will also help when someone is using text based browsers like Lynx.
  • By having ALT attribute you are increasing the keyword density which is very good in terms of
    Search Engine Optimalisation (SEO).
What about decorative images?

The alt attribute for decorative images should be empty [alt=""] to meet the accessibility and XHML standards. If you include an empty alt attribute, screen readers will skip over the image. If you don't... the screenreader will read the entire URL of the image, which is quite annoying for the visitor.

What about the ASP.NET image control?

By default, when the AlternateText property is not set, the Image control does not include the alt attribute to specify the alternate text in the control rendering. If you set this attribute to be empty [AlternateText=""] you will notice that the control ignores it too.

Fortunately, since .NET 2.0, the image control contains a GenerateEmptyAlternateText property. It specifies whether or not the control creates an empty string as an alternate text. Set the GenerateEmptyAlternateText property to true to always include the alternate text attribute in rendered output for the Image control.

Thursday, May 7, 2009

Off-topic: Have you ever been to New York?

Take a look at that wonderful Aerial Virtual tour.
  • Turn on your speakers
  • Left below you'll find more views
  • Don't forget to enter the fullscreen
@TomPoint: Don't look at it.Within a couple weeks you'll see it in reality. :)