Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I'm creating a web part. I need an update panel to refresh controls when using dropdowns list. I dont know why but it's missing the namespace when it shouldnt right?

using Microsoft.SharePoint;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;

protected override void CreateChildControls()
    {
        updatePanel2 = new UpdatePanel();
        updatePanel2.UpdateMode = UpdatePanelUpdateMode.Conditional;

        toolPartPanel = new Panel();
        label2 = new Label();
share|improve this question
    
Can you provide the exact text of the error you're seeing? –  mason Jun 25 '13 at 14:41
    
yes of course. the error is: "The type or namespace name 'UpdatePanel' could not be found (are you missing a using directive or an assembly referece?)" –  nhenrique Jun 25 '13 at 14:43
add comment

2 Answers

In your project's references, have you included a reference to System.Web.UI? Usually when it doesn't give you the option to resolve it's because the DLL reference is missing.

share|improve this answer
    
I cant see System.Web.UI on the list to add references. There's a lot of System.Web..something but not UI. –  nhenrique Jun 25 '13 at 14:56
1  
Well, it may already be added--do you see it in the list of references? –  Garrison Neely Jun 25 '13 at 14:57
    
ye, i was using System.Web.UI.HtmlControls and others. Now i just added System.Web.UI and it seems fine. Thank you! It is strange that such a simple thing and Visual Studio could suggest me a namespace like it does most of the times. –  nhenrique Jun 25 '13 at 15:00
add comment

Add this to the top.

using System.Web.UI

The control was not where you thought it would be. You can check the namespace in the documentation: http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx

Or if you're using Visual Studio, hover your mouse over the UpdatePanel word and it will suggest options for resolving the namespace.

share|improve this answer
    
i did that but its the same. I know about that solution, usually you just have to mouseover > resolve and add the suggested. But this one doesnt appear anything. –  nhenrique Jun 25 '13 at 14:40
add comment

Your Answer

 
discard

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.