Error: 'Table' does not contain a definition for 'BorderStyle'
-
Hi All, I am trying to create a table but getting following complie time error: Error: 'Table' does not contain a definition for 'BorderStyle' can anyone help please. Here are my code for review: Table tbl = new Table(); tbl.BorderStyle = BorderStyle.Solid; //Error at this line tbl.BorderColor = Color.Black; tbl.CellSpacing = 0; Thanks, A.Asif
A.Asif
-
Hi All, I am trying to create a table but getting following complie time error: Error: 'Table' does not contain a definition for 'BorderStyle' can anyone help please. Here are my code for review: Table tbl = new Table(); tbl.BorderStyle = BorderStyle.Solid; //Error at this line tbl.BorderColor = Color.Black; tbl.CellSpacing = 0; Thanks, A.Asif
A.Asif
The System.Web.UI.WebControls.Table class has a BorderStyle property, so that's obviously not the class that you created. Is that the class that you intended to create? Is it a WPF project? Then you use BorderBrush and BorderThickness to specify the border.
Despite everything, the person most likely to be fooling you next is yourself.
-
The System.Web.UI.WebControls.Table class has a BorderStyle property, so that's obviously not the class that you created. Is that the class that you intended to create? Is it a WPF project? Then you use BorderBrush and BorderThickness to specify the border.
Despite everything, the person most likely to be fooling you next is yourself.
Hi, Thanks for your help. However, I am using System.Web.UI.WebControls.Table class that has a BorderStyle property, so obviously I should NOT get this error, but for some reason I am geting this error. Also this not a WPF project. Any idea what could be wrong, I am using VS 2005. Please help if you can. Thanks
A.Asif
-
Hi, Thanks for your help. However, I am using System.Web.UI.WebControls.Table class that has a BorderStyle property, so obviously I should NOT get this error, but for some reason I am geting this error. Also this not a WPF project. Any idea what could be wrong, I am using VS 2005. Please help if you can. Thanks
A.Asif
Well, since you just specified "Table" and not "System.Web.UI.WebControls.Table" explicitly, you're using a Table class from a different namespace. That's why yo're getting this message. Change the code to be specific and you won't see this error.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008