|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Creating extra classesmake 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. Put it in the App_Code directory.
Nathan Sokalski wrote: Show quoteHide quote > 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.
String and int Issue
MDI Form loading Visual Basic 6.0, Enterprise Edition ASP.NET: VSNET2003 to VSNET2005 Global.asax.vb in Visual Studio .NET 2005 Question on XMLSerialization Comparing recordsets in VB2005 DirectX and False Stretching Images Writing ActiveX DLL in VB 2005 Datefield from variable into a datefield in an access b |
|||||||||||||||||||||||