|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
JAVASCRIPT IN ASP.NETHow can i add javascript code to my server control object ?
I want to add a javascript code when a user OnClick it .. Is there any sample code or reference web site or knowledge to solve it ? <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 6px; POSITION: absolute; TOP: 6px" runat="server" Text="Button"></asp:Button> Use the Attributes property. Here is a simple little function I wrote for
myself to create rollovers, but it's a good example of how to use the Attributes property: 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 The Add method of the Attributes property takes two parameters, the attribute's name and value, both of which are of type String. I'm sure you can take it from here, if you want more help, just ask or look at the help files. Good Luck! Show quoteHide quote "Savas Ates" <in da club> wrote in message news:OBCb7eJLGHA.1532@TK2MSFTNGP12.phx.gbl... > > How can i add javascript code to my server control object ? > > I want to add a javascript code when a user OnClick it .. > > Is there any sample code or reference web site or knowledge to solve it ? > > <asp:Button id="Button1" style="Z-INDEX: 101; LEFT: 6px; POSITION: > absolute; TOP: 6px" runat="server" > Text="Button"></asp:Button> >
storing image in Access table
System.IO.File.Exists How can I read an XML string directly into a dataset without creating a file? Can I create windows form by using late binding? HTML in to readable/value accessible object what to do, what to do Text file printout in dos mode through VB.Net or DOS command from VB.Net Setup Project Help Displaying & Stabilizing PictureBox Contents passing a list as a parameter to a TableAdapter Fill method |
|||||||||||||||||||||||