I decided to start posting some tips and info on some of the new things and code tips for .NET for those wanting to learn and are unsure of the new additions and changes.
Todays Tip: What is this Imports thing I see in the following code?
The easiest way to explain Imports is, think of it as a With...End With statement from Vb 6 and under.Code:Imports System.Web.UI.WebControls Dim myLabel As Label Dim myBox As TextBox ... ...
What it does is provide a shortcut to classes/collections/objects available in the Namespace Imports provides
So in the above code its keeps your from having to type that namespace multiple times
Without it, your code would look like this:
I hope this clears this up for anyone confused by Imports since you WILL be seeing it alot.Code:Dim myLabel As System.Web.UI.WebControls.Label Dim myBox As System.Web.UI.WebControls.TextBox
Feel free to reply with any questions and I will do my best to answer them




Reply With Quote