Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / June 2006

Tip: Looking for answers? Try searching our database.

Creating extra classes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nathan Sokalski - 30 Jun 2006 07:13 GMT
I recently upgraded from VS 2003 to VS 2005. In VS 2003 all I had to do to
make an extra class was put the following in a *.vb file:

Imports System.Web.UI
Imports System.Web.UI.WebControls
Public Class MiscExtras
   Public Shared Sub AddRollover(ByVal img As Web.UI.WebControls.Image,
ByVal rollover As String)
       'Adds the rollover feature to an Image or ImageButton (or other
class that inherits from an Image)
       img.Attributes.Add("onmouseover", "this.src='" & rollover & "';")
       img.Attributes.Add("onmouseout", "this.src='" & img.ImageUrl & "';")
   End Sub
End Class

And then to access it from a file in the same I would use the following:

MiscExtras.AddRollover(imgHomeButton,
"images/MenuBarButtons/HomeRollover.gif")

However, when I try to do this in Visual Studio .NET 2005 I get the error
'Name MiscExtras is not declared.'. I also tried putting the file in the
App_Data directory that is automatically created, but it did not make any
difference. What am I doing wrong? Thanks.
Signature

Nathan Sokalski
njsokalski@hotmail.com
http://www.nathansokalski.com/

Göran Andersson - 30 Jun 2006 08:45 GMT
Put it in the App_Code directory.

> I recently upgraded from VS 2003 to VS 2005. In VS 2003 all I had to do to
> make an extra class was put the following in a *.vb file:
[quoted text clipped - 20 lines]
> App_Data directory that is automatically created, but it did not make any
> difference. What am I doing wrong? Thanks.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.