Hello,
two questions about the following code (.aspx file):
Why doesn't the 'Text' property of control 'Label1' get changed in the
function 'SetLabelText()'?
How do I trigger the 'SetLabelText()' function when the mouse moves over the
label control? The line code as below does not function.
Thanks.
<html>
<head>
<script language="VB" runat="server">
Sub SetLabelText()
Label1.Text &= "SetLabelText"
Response.Write ("<br>Hallo")
End Sub
Sub Page_Load(sender As Object, e As EventArgs)
TextBox1.Attributes("onmouseover") = "javascript:alert('Hello!
mouse is over textbox!!')"
Label1.Attributes("onmouseover") = "<% SetLabelText() %>"
End Sub
</script>
</head>
<body>
<h3>Attributes Property of a Web Control</h3>
<form runat="server">
<asp:TextBox id="TextBox1" columns=54 Text="Move mouse over textbox to
trigger onmouseover event." runat="server"/>
<asp:label id="Label1" runat="server" Text="TESTING" />
<% SetLabelText() %>
</form>
</body>
</html>