JavaScript events

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Javier Ros

    #1

    JavaScript events

    hi guys,

    I want to write events in JavaScript for my asp controls (TextBox for
    example).

    This is the HTML code of my WebForm, it have only a TextBox:

    <%@ Page language="c#" Codebehind="Web Form1.aspx.cs" AutoEventWireup ="false"
    Inherits="WebAp plication1.WebF orm1" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1 </title>
    <meta name="GENERATOR " Content="Micros oft Visual Studio 7.0">
    <meta name="CODE_LANG UAGE" Content="C#">
    <meta name="vs_defaul tClientScript" content="JavaSc ript">
    <meta name="vs_target Schema" content="...">
    </HEAD>
    <body MS_POSITIONING= "GridLayout ">
    <form id="Form1" method="post" runat="server">
    <asp:TextBox id="TextBox1" style="Z-INDEX: 101; LEFT: 164px; POSITION:
    absolute; TOP: 80px" runat="server"> </asp:TextBox>
    </form>
    </body>
    </HTML>

    And this is the HTML code generate by the server:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
    <HTML>
    <HEAD>
    <title>WebForm1 </title>
    <meta name="GENERATOR " Content="Micros oft Visual Studio 7.0">
    <meta name="CODE_LANG UAGE" Content="C#">
    <meta name="vs_defaul tClientScript" content="JavaSc ript">
    <meta name="vs_target Schema" content="...">
    </HEAD>
    <body MS_POSITIONING= "GridLayout ">
    <form name="Form1" method="post" action="WebForm 1.aspx" id="Form1">
    <input type="hidden" name="__VIEWSTA TE"
    value="dDwyMTA1 NTI4MTE3Ozs+u44 Ib3Yg/KNtF+PuxRv2LA/u8HE=" />

    <input name="TextBox1" type="text" id="TextBox1" style="Z-INDEX: 101;
    LEFT: 164px; POSITION: absolute; TOP: 80px" />
    </form>
    </body>
    </HTML>

    Well, how to add 'OnExit = "callMyJavaScri ptFunction();"' to "input" tag in
    the generate Code by the server from C# codebehind?
    I have thought in "PreRender" Event of TextBox Control but ... I don“t know
    how to.

    thanks in advance.

    ..Javier Ros Moreno.

    P.D.: Sorry, my Inglish is poor, I want generate this:
    I want this: <input name="TextBox1" type="text" id="TextBox1"
    style="Z-INDEX: 101; LEFT: 164px; POSITION: absolute; TOP: 80px" OnExit =
    "callMyJavaScri ptFunction();" />



Working...