I have created a web scoped feature. In FeatureActivated method I try to GetLimitedWebPartManager from default.aspx file. But the web has not been created yet and default.aspx does not exists.
|
|
The best solution is to move to provisioning of Default.aspx into a Feature and then activate that feature prior to the feature adding the web part. If that's not an option then you can use the following pattern which is common when changing MySites:
This is required due the sequence of provisioning sites which is:
|
|||||||
|
|
As far as I understand, you want to execute a piece of code in your default.aspx page when a feature is activated. As you said, since the page is not loaded on this event, you won't be able to get to it. The best way would be to think of adding a custom master page when the feature is activated. The custom master page should have a delegate control attached to it, which internally has the piece of code which you have in your default.aspx. As you know that master page gets loaded all the time, the piece of code in your delegate control will fire up for each page refresh. So, check to execute the code when and where required, just one time. Hope I have understood your problem correctly. Good Luck ... |
|||
|