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.
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.