Hi - I've added the following to my webpart:
this.attributes.add("onmousedown","bob()");
and this in Render():
this.attributes.addattributes(writer);
However, when I check the html for the page, the onmousedown attribute has been added to the webpart below mine so when I click on the webpart below, the function bob() is being called. Am I doing something wrong?
I found the solution. I was creating a div in render() that contained all my controls. I was adding the attribute after the div and for some reason it added the attribute to the following webpart. I simply called this.attributes.addattribute(writer) at the beginning of render().
ps. sorry about mulitple submissions. I must have hit the post button three times and couldn't find a way to delete posts from the forum.