Silverlight 1.0 Released and Siverlight for Linux Announced

5 09 2007




Come see me present at the APAC SharePoint Conference in May!

27 03 2007

Just like Aaron, I too will be presenting at the APAC SharePoint Conference!

I will be presenting a 30 minute Cabana session on setting up alternate membership/role providers with a focus on the SqlMembershipProvider and the ASP.NET 2.0 membership controls.

I hope to make the session as informative, and developer oriented as possible.

If you are doing any work with MOSS – or you are just about to take the dive, then you should definitely be considering heading to the conference.

Be quick though, as these things will sell fast!

Click the image below to see the session details:

Matthew Cosier - Session Details

Big thanks to Angus for setting me up with this role! (no pun intended)





ASP.NET 2.0 Menu – MenuItemClick not posting back/firing event

23 12 2006

This can occur if you have set the MenuItem’s Text property to HTML. The behavior occurs due to the way that MenuItem’s end up being rendered into HTML. Each menu item has an <a href=”" mce_href=”"> link, so when you click on a MenuItem it’s the same as clicking on any other link, except the href contains a “JavaScript:__doPostback” call, which will trigger the event on the server side.

Now, what happens is that when you set your Text property to a chunk of HTML, (a table, for instance), that link is being hidden by those elements you have set – causing any click on the menu item to be sent directly to that container, rather than invoking the link click.

A way around this, is to set the onclick of the outer container of your HTML for the MenuItem to something which will invoke the contents of the parents href script:

tbl.Attributes.Add(“onclick”, “eval(this.parentNode.parentNode.getAttribute(‘href’).substring(11));”);

The reason we are using parentNode.parentNode is because the HTML contents you set in your Text property is embedded inside a div. So we need to get to it’s parent, which is the link containing the href with the postback script.

We then evaluate that javascript code we find in the href attribute, all except the “JavaScript:” qualifier. And voila! Our menu item’s click event is raised…

Hope this helps someone else – it can get quite confusing if you don’t understand how these things work under the hood.