Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11508

How to add custom properties in my visual Webpart ?

$
0
0

Hi

i've created new visual web part for my sharepoint 2010 via this link.

now i want to add custom properties to my visual web part, but i can not see my properties in "Editing Webpart" toolbox.

i also use some resources like this to add some attributes in my visual webpart, but nothing happened!

here is my code which display how to create custom properties :

[ToolboxItemAttribute(false)]
    public partial class VisualWebPart1UserControl : UserControl
    {
        private static DataTable _dtResult;
        private string _connectionString;

        [Personalizable(), WebBrowsable]
        public string ConnectionString
        {
            get
            {
                return this._connectionString;
            }
            set
            {
                this._connectionString = value;
            }
        }
     
        // other codes

}

Does something wrong ?

thanks in advance


http://www.codeproject.com/KB/codegen/DatabaseHelper.aspx


Viewing all articles
Browse latest Browse all 11508

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>