SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am working on some mobile web parts and have got into a problem.

My issue is that I have a custom web part which is a mobile web part. I have got everything working and I can see the web part in the SharePoint mobile pages. I want to have an update panel in my web part and for that I added the scriptmanager on the user control web part.

Now when I see my web part on the page I get an error Object reference not set to an instance of an object. If I remove the update panel and script manager, everything is working fine as expected. So if someone can tell me how can I get script manager running in a SharePoint mobile page I would really appreciate it.

The page which SharePoint uses to display mobile web parts is mblwp.aspx and I guess there is no master page in mobile pages.

share|improve this question

Try adding the following to the CreateChildControls override of your user control code-behind:

    if (System.Web.UI.ScriptManager.GetCurrent(this.Page) == null)
        System.Web.UI.ScriptManager scriptMgr = new System.Web.UI.ScriptManager();
        this.Controls.AddAt(0, scriptMgr);

...before base.CreateChildControls();

Should cause the script manager to be added correctly, but only if one is not already present. If that doesn't work, try:


in place of:

this.Controls.AddAt(0, scriptMgr);

Hope that does the trick.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.