Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
using System;
using System.Runtime.InteropServices;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Serialization;

using System.Data;
using System.Data.SqlClient;


using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.WebPartPages;

I am using the above header files

public class ApplicationForm : System.Web.UI.WebControls.WebParts.WebPart
    {
        // WebPart Parameter for getting the Connection string
        [
        WebBrowsable(true),
        WebDisplayName("Connection String"),
        Personalizable(PersonalizationScope.User)

        ]
    }

It throws an error for custom attribute:

Error   1   Attribute 'WebBrowsable' is not valid on this declaration type. It is only valid on 'property, indexer' declarations.
share|improve this question
2  
Is that the complete snippet? As mentioned in the error the attributes should be on a Property or an Indexer. The snippet given in the question does not have anything after the attributes –  Floyd Pink Oct 2 '11 at 16:12
    
Thank you. I sorted it..your comment helped me –  Hari Gillala Oct 2 '11 at 17:13
    
You're welcome. You could post it and mark that as the answer –  Floyd Pink Oct 2 '11 at 17:15
    
See my question for a complete example (and an easy way to add web part properties!). –  Kit Menke Oct 2 '11 at 23:49
add comment

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.