JavaScript detection. In the loopback

Source: Internet
Author: User

<body ms_positioning= "GridLayout" >
<form id= "Form1" method= "POST" runat= "Server" >
<asp:button id= "Button1" style= "Z-INDEX:101; left:16px; Position:absolute; top:192px "runat=" Server "
text= "Server 1" ></asp:Button>
<asp:textbox id= "TextBox1" style= "z-index:102; left:16px; Position:absolute; TOP:24PX "runat=" Server "
height= "144px" width= "280px" textmode= "MultiLine" ></asp:TextBox>
<asp:label id= "Label1" style= "z-index:103; left:32px; Position:absolute; top:248px "runat=" Server "
height= "96px" width= "248px" >Label</asp:Label>
<input style= "z-index:104; left:192px; Position:absolute; top:192px "type=" button "
Value= "Customer" id= "bt11" onclick= "AA" (); " >
<asp:button id= "Button2" style= "z-index:105; left:104px; Position:absolute; top:192px "runat=" Server "
text= "Server 2" ></asp:Button>
<asp:label id= "Label2" style= "z-index:106; left:312px; Position:absolute; top:248px "runat=" Server "
Width= "208px" height= "88px" >Label</asp:Label>
<asp:hyperlink id= "HyperLink1" style= "z-index:107; left:400px; Position:absolute; Top:32px "
runat= "Server" navigateurl= "select_test.aspx" >select_text</asp:HyperLink>
</form>
<script language= "JavaScript" >
function AA ()
{
Use this method to get the numeric value of the server-side control. Manipulating elements on a page with the DOM
Alert (document.getElementById (' TextBox1 '). value+ "---server Control value");
To have the client code trigger the loopback event.
Alert ("Client-triggered event");
document.getElementById (' Button1 '). Click ();
}

</script>
</body>

private void Button1_Click (object sender, System.EventArgs e)
{
This. Label1.text=this. TextBox1.Text;
This. Button2_Click (SENDER,E)//Trigger Press 2 Event
}

private void Button2_Click (object sender, System.EventArgs e)
{
This. Label2.text=this. TextBox1.Text;
}



--------------------------------------------------------------------------------------------------------------- ----------------

<script language=javascript>
function AA ()
{
Alert (document.getElementById (' ListBox1 '). value);//Get the first selected element of select
Alert (document.getElementById (' ListBox1 '). Length)//Get the total number of elements for a multiple-selection box
Get all the selected elements in the Select
For (Var I=0;i<document.getelementbyid (' ListBox1 '). length;i++)//Total length
{
if (document.getElementById (' ListBox1 '). Options (i). Selected)//detect whether an element is selected
Alert (document.getElementById (' ListBox1 '). Options (i). Value)//Get the value of an element
}
}

</script>

--------------------------------------------------------------------------------------------------------------- -----------------

<body ms_positioning= "GridLayout" >
<form id= "Form1" method= "POST" runat= "Server" >

<asp:button id= "Button1" style= "Z-INDEX:101; left:48px; Position:absolute; top:128px "runat=" Server "
text= "Server" width= "0px" ></asp:button><input style= "z-index:102; Left:12



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.