Results 1 to 27 of 27

Thread: The .NET Tip Thread

Threaded View

  1. #1

    Thread Starter
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913

    The .NET Tip Thread

    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?

    Code:
    Imports System.Web.UI.WebControls
    
    Dim myLabel As Label
    Dim myBox As TextBox
    ...
    ...
    The easiest way to explain Imports is, think of it as a With...End With statement from Vb 6 and under.

    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:

    Code:
    Dim myLabel As System.Web.UI.WebControls.Label
    Dim myBox As System.Web.UI.WebControls.TextBox
    I hope this clears this up for anyone confused by Imports since you WILL be seeing it alot.

    Feel free to reply with any questions and I will do my best to answer them
    Last edited by Cander; Nov 8th, 2001 at 10:43 AM.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width