Copy codeThe Code is as follows:
<% @ Page Language = "C #" AutoEventWireup = "true" CodeFile = "Default. aspx. cs" Inherits = "_ Default" %>
<! 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">
<Head runat = "server">
<Title> Untitled Page </title>
<Style type = "text/css">
# Mydiv
{
Height: 89px;
}
</Style>
<Script runat = "server"> // server-side scripting language ④
Protected void Page_Load (object sender, EventArgs e)
{
Button1.Attributes. Add ("onclick", "javascript: return confirm ('Are you sure you want to delete it? ') "); // The pop-up dialog box appears when you click button1.
}
Protected void button#click2 (object sender, EventArgs e)
{
Response. Write ("is the deletion task executed !! "); // Click agree to execute or not to execute
}
</Script>
<Script language = "javascript" type = "text/javascript"> // browser script ②
Function tupian_onclick (tupian) // you need to transmit parameters to the server.
{
Tupian. src = "banner_right_02.gif"
}
Function tupian_onmouseover (tupian ){
Tupian. src = "banner_right_02.gif ";
}
Function tupian_onmouseout (tupian ){
Tupian. src = "banner_right_01.gif ";
}
</Script>
</Head>
<Body onload = "test ()"> // load the function in the script file
<Script language = "javascript"> ①
Document. write ("<font color = blue> hello, Javascript! </Font> ");
</Script> // display strings on the webpage
<Form id = "form1" runat = "server"> // form
<Div>
Onclick = "return tupian_onclick (tupian)" onmouseover = "return tupian_onmouseover (tupian)" onmouseout = "return tupian_onmouseout (tupian)/> -- parameters must be added to the server javascript script function call.
<Div id = "mydiv" onclick = "return mydiv_onclick ()"> </div> defines an ID as mydiv.
<Script src = "test. js"> // call the script file ③
</Script>
<Asp: Button ID = "Button1" runat = "server" Text = "pop-up confirmation box" onclick = "button#click2"/>
<Asp: ImageButton ID = "ImageButton1" runat = "server"
ImageUrl = "~ /Banner_right_01.gif "onclick =" ImageButton1_Click "onmouseover =" this.src?'banner_right_02.gif '"onmouseout =" this.src='banner_right_01.gif' "/>
// In the case of Class 1, the server does not respond to the mouse movement event. This method can be used to return the mouse movement time on the client.
</Div>
</Form>
</Body>
</Html>