Creating extra classes

N

Nathan Sokalski

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top