Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ICSCI N201 Project Two Event Handler Description: Create a web page to demonstra

ID: 3605333 • Letter: I

Question

ICSCI N201 Project Two Event Handler Description: Create a web page to demonstrate button click events. The page should contain at least two buttons. When each button is clicked, an image related to the button will show on the page, together with a paragraph describing the image. Eg. The page can have three buttons, one says "IUPUI", one says "Purdue", one says "IU". When the IUPUI button is clicked, a picture of the IUPUI campus will show, and below the picture is a brief introduction of IUPUI, You can choose any topic that you like, e.g. your favorite animals, food, national parks etc. You can be creative in styles of the web page. You can use the web page you created in project one as a template. You can choose to allow only one image/paragraph to stay on the web page or allow multiple images/paragraphs to show on the page. Tips 1There are two ways to make your image show on the web page. Use the name of the image file as the image source, as on slide #11, Chapter02. If you do it this way, you must create a folder, and put both the web page file (the HT4 file) and the image file in this folder Use a hyper link (includng the file name) as the image source, as on slide #8, Chapter04 a. b. 2. If you want to allow multiple ip es or paragraphs to show on the web page, you need to create multiple simgo and

Explanation / Answer

<%@ Page Language="C#" %>

<!DOCTYPE html>

<script runat="server">

    protected void Button1_Click(object sender, System.EventArgs e)

    {

        Label1.Text = "You clicked the first button.";

    }

    protected void Button2_Click(object sender, System.EventArgs e)

    {

        Label1.Text = "You clicked the second button.";

    }

</script>

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

<head runat="server">

    <title>How to use Button Click event in asp.ent</title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <h2>     

            Button OnClick() method and click event

        </h2>     

        <hr width="450" align="left" color="Gainsboro" />

        <asp:Label

            ID="Label1"

            runat="server"

            Font-Size="X-Large"

            ForeColor="Crimson"

            Font-Italic="true"

            />

        <br /><br />

        <asp:Button

            ID="Button1"

            runat="server"

            Text="First Button"

           

            Font-Bold="true"

            ForeColor="DodgerBlue"

            Height="45"

            Width="150"

            />

        <asp:Button

            ID="Button2"

            runat="server"

            Text="Second Button"

           

            Font-Bold="true"

            ForeColor="DodgerBlue"

            Height="45"

            Width="150"

            />

    </div>

    </form>

</body>

</html>