Web project contained language code support interface

Hi,

I have a question regarding the IVsContainedLanguageCodeSupport interface. Or more specifically one of its members, EnsureEventHandler.

I currently have my codeprovider up and running. The designer works and drag and drop from the tool box works. The only problem is when I double click on the control (dropped from the tool box) in the designer (say for example a button) the contained language's EnsureEventHandler method does not get called.

I want to be able to insert my own event code into the code file of the ASPX page (MyFile.aspx.cs). And the only method I can find that does this is EnsureEventHandler.

Is this the correct approach If so, what is required to get the EnsureEventHandler method to be called. If not, where should I be looking

Thanks,

LTN



Answer this question

Web project contained language code support interface

  • nkabirwa

    Found the answer.

    It seems the EnsureEventHandler method gets called if in the GetEventHandlerMemberID method you set pbstrUniqueMemberID to null. Any other value will NOT invoke the EnsureEventHandler method down the line. And from within the EnsureEventHandler you can specify the code you want to insert into your code page and all done.

    LTN


  • Web project contained language code support interface