Learning Curve…

How to add missing namespace in aspx.cs …

Posted on: December 15, 2011

Lets say , you have added a class with a different namespace folder or project  and then calling this class in your aspx.cs page where you have not added class’s namespace.Notice how you immediately get an error when you type class name because it’s defined in a namespace that is not in scope. You can fix the proble in two ways.

1. You can type Imports class’s namespace if you’re using VB.NET or using class’s namespace; if you’re using C# at the top of the code file.

2.You can click the word class name in your calling page once and then press Ctrl+. (Ctrl+Dot) to bring up a dialog that lets you choose the fix for the problem. Choose the appropriate item and .net will adds the necessary Imports/using statement for you.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Learning days (Calendar)

December 2011
« Nov   Jan »

Knowledge Bank (Archives)

I am on Twitter

Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Blog Stats

  • 510,129 hits

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 43 other followers

%d bloggers like this: