Introduction to asp + syntax (4) ---- introduction to asp + server-side programming

Source: Internet
Author: User

Events that operate on Server controls
Each asp + server control has its own attributes, methods, and events. Asp + developers can now clearly modify and interact with their own pages
In the following example, we use two server controls: <asp: button runat = server> and <asp: label runat = server>.
And button click events

The code is as follows: Copy code
<Html>
<Head>
<Link rel = "stylesheet" href = "intro.css">
</Head>
<Script language = "VB" runat = server>
Sub SubmitBtn_Click (Sender As Object, E As EventArgs)
Message. Text = "Hi" & Name. Text & ", you selected:" & Category. SelectedItem. Text
End Sub
</Script>
<Body>
<Center>
<Form action = "intro6.aspx" method = "post" runat = "server">
<Asp: adrotator AdvertisementFile = "ads. xml" BorderColor = "black" BorderWidth = 1 runat = "server"/>
<H3> Name: <asp: textbox id = "Name" runat = "server"/>
Category: <asp: dropdownlist id = "Category" runat = server>
<Asp: listitem> psychology </asp: listitem>
<Asp: listitem> business </asp: listitem>
<Asp: listitem> popular_comp </asp: listitem>
</Asp: dropdownlist>
<Asp: button type = submit text = "Lookup" OnClick = "SubmitBtn_Click" runat = "server"/>
<P>
<Asp: label id = "Message" runat = "server"/>
</Form>
</Center>
</Body>
</Html>

In this simple example, we have also demonstrated it in example 3, but now we use a simple and clear method to demonstrate the functions of the new version of server controls.

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.