I'm creating a panel in order to fill it up with some controls but i got error when i try to write its properties.
My code:
public partial class _Default : System.Web.UI.Page
{
Panel pbx;
protected void Page_PreInit(object sender, EventArgs e)
{
//Create a Dynamic Panel
pbx = new Panel();
pbx.ID = "pbx";
pbx.BorderWidth = 1;
pbx.Width = 300;
this.form1.Controls.Add(pbx);
}
//some other functions
}
Visual Studio 2012 underlines "ID", "BorderWidth" and "Width" words, so i cant run the project. one of errors is like this:
'simplePanel.Panel' does not contain a definition for 'BorderWidth' and no extension method 'BorderWidth' accepting a first argument of type 'simplePanel.Panel' could be found (are you missing a using directive or an assembly reference?)
edit: I can create a textbox or label with no problem. But not a panel.