Click here to Skip to main content
15,905,144 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Question clears it all.
I want to know How can I execute any event or call a function when a text field on a web page loaded within a web browser control of windows form get focus.Thanks in advance
Posted

1 solution

XML
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm6.aspx.vb" Inherits="WebApplication1.WebForm6" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >

<script type="text/javascript" language="javascript">
function EnterEvent(e) {
         alert("You have pressed a key.");
        }
</script>

<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TextBox ID="TextBox1" runat="server" Width="209px" onkeypress="return EnterEvent(event)"></asp:TextBox></div>
    </form>
</body>
</html>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900