add scriptmanager page programmatically?


i am building webpart (it used sharepoint environment, nonetheless does vigilant model) i wish arrangement ajax functionality in. since inlet environment, adding book manager directly page an option, contingency total programmatically. i have attempted supplement scriptmanager control page webpart code.



protected overrule vacant createchildcontrols()
{
(scriptmanager.getcurrent(page) == null)
{
scriptmanager smgr = new scriptmanager();
// pledge scriptmanager initial control.
page.form.controls.addat(0, smgr);
}
}


however, formula executed, i following blunder message:




"the control collection can't run-down during databind, init, load, prerender empty phases."




is there another proceed supplement scriptmanager page webpart, am i going have only supplement scriptmanager any page (or master page) webpart?



Comments

Popular posts from this blog

list macos calm editors formula editors

how i practical urls indicate .aspx pages asp.net deployed an iis? (preferably but iis)

jaxb - xjc - reworking generated typesafe enum category members