Pages

Thursday, March 20, 2008

Missing Event Handlers

First, has anyone other than me noticed that it takes like 2+ minutes for Visual Web Developer to fully open and come alive? What the hell is it doing? We'll save that for another time.

So you create an Ajax Web Form. You want to put an even handler on Init of the form. How? There is no event icon in the object inspector for the document.

So you click on the Script manager and presto! you get the little lightning bolt icon.

Let's try it with a master page. We create a master and a content page and guess what? There is NO WAY to add an onInit handler to the content page. There's no script manager. If you open the .cs code file and/or double-click the page in the designer, you get a page_load function.

You can try to add one by hand, but where would you put that?....

Ok lets move on.

Slap a button on the screen, and then select the button. Wohoo! the little lightning bolt is there!

Now create a table and put in a row and a cell and put the button in there. Oops, you can no longer click the button and create event handlers, you keep getting the table. In fact the only way I have found to add a handler is to drag the button out of all the panels, tables, etc., and edit it's event handlers, then drag it back into it's table cell and hope it all works.

This is goofy.

The solution is to create all components you need to access the events of outside all tables tables or panels, create the event handlers and then drag (or cut/paste) the objects back into the table or panel.

No comments:

Share This!

Contact Us

Name

Email *

Message *