Net Core教程

WEB开发技术基础试题(ASP.NET)

本文主要是介绍WEB开发技术基础试题(ASP.NET),对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

效果显示

 HTML页面显示

HTML代码 

<%@ 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></title>
    </head>
<body>
    <form id="form1" runat="server">
    <div>
    <h3>WEB开发技术基础试题</h3>
        <br />
        一、单选题(每小题25分,共50分)<br />
        <br />
        1.asp.net文件的扩展名是()。<asp:RequiredFieldValidator ID="RequiredFieldValidator1" 
            runat="server" ControlToValidate="RadioButtonList1" ErrorMessage="选项不能为空" 
            ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
&nbsp;<br />
&nbsp;<asp:RadioButtonList ID="RadioButtonList1" runat="server" 
            RepeatDirection="Horizontal">
            <asp:ListItem>A.CS</asp:ListItem>
            <asp:ListItem>B.aspx</asp:ListItem>
            <asp:ListItem>C.asp</asp:ListItem>
            <asp:ListItem>D.ascx</asp:ListItem>
        </asp:RadioButtonList>
&nbsp;<br />
        <br />
        2.HTML是一种()。<asp:RequiredFieldValidator ID="RequiredFieldValidator2" 
            runat="server" ControlToValidate="RadioButtonList2" ErrorMessage="选项不能为空" 
            ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:RadioButtonList ID="RadioButtonList2" runat="server" 
            RepeatDirection="Horizontal">
            <asp:ListItem>A.机器语言</asp:ListItem>
            <asp:ListItem>B.编程语言</asp:ListItem>
            <asp:ListItem>C.标记语言</asp:ListItem>
            <asp:ListItem>D.汇编语言</asp:ListItem>
        </asp:RadioButtonList>
        <br />
        <br />
        二、多选题(每小题25分,共50分)<br />
        <br />
        1.下面所用的动态页面制作效果是()。<asp:RequiredFieldValidator ID="RequiredFieldValidator3" 
            runat="server" ControlToValidate="RadioButtonList1" ErrorMessage="选项不能为空" 
            ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:CheckBoxList ID="CheckBoxList1" runat="server" 
            RepeatDirection="Horizontal">
            <asp:ListItem>A.asp</asp:ListItem>
            <asp:ListItem>B.asp.net</asp:ListItem>
            <asp:ListItem>C.flash</asp:ListItem>
            <asp:ListItem>D.jsp</asp:ListItem>
        </asp:CheckBoxList>
        <br />
        <br />
        2.一个asp.net网页通常由以下哪()两个独立的文件组成。<asp:RequiredFieldValidator 
            ID="RequiredFieldValidator4" runat="server" 
            ControlToValidate="RadioButtonList2" ErrorMessage="选项不能为空" ForeColor="Red"></asp:RequiredFieldValidator>
        <br />
        <br />
        <asp:CheckBoxList ID="CheckBoxList2" runat="server" 
            RepeatDirection="Horizontal">
            <asp:ListItem>A.aspx设计页面</asp:ListItem>
            <asp:ListItem>B.html前台页面</asp:ListItem>
            <asp:ListItem>C.CS代码页面</asp:ListItem>
            <asp:ListItem>D.asp代码页面</asp:ListItem>
        </asp:CheckBoxList>
        <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="确定" />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
        <asp:Button ID="Button2" runat="server" onclick="Button2_Click" Text="清除" />
        <br />
        <asp:Label ID="Label1" runat="server"></asp:Label>
    </div>
    </form>
</body>
</html>

事件代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        int score = 0;
        String result = null;
        result += "答正确的题目如下所示:<br><br>一、单选题(每小题25分,共50分)";
        if (RadioButtonList1.Items[1].Selected == true)
        {
            result += "<br><br>1.asp.net文件的扩展名是:" + "<br><br>" + RadioButtonList1.SelectedItem.Text;
            score += 25;
        }
        if (RadioButtonList2.Items[3].Selected == true)
        {
            result += "<br><br>2.HTML是一种():" + "<br><br>" + RadioButtonList2.SelectedItem.Text;
            score += 25;
        }
        result += "<br><br>二、多选题(每小题25分,共50分)";
        if (CheckBoxList1.Items[0].Selected == true && CheckBoxList1.Items[1].Selected == true)
        {
            result += "<br><br>1.下面所用的动态页面制作效果是():" + "<br><br>" + CheckBoxList1.Items[0].Text +
                "<br><br>" + CheckBoxList1.Items[1].Text;
            ;
            score += 25;
        }
        if (CheckBoxList2.Items[0].Selected == true && CheckBoxList2.Items[2].Selected == true)
        {
            result += "<br><br>2.一个asp.net网页通常由以下哪()两个独立的文件组成:" +
                "<br><br>" + CheckBoxList2.Items[0].Text + "<br><br>" + CheckBoxList2.Items[2].Text;
            score += 25;
        }
        Label1.Text = result + "<br><br>您的最后得分是:" + score;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
        Label1.Text = null;
        RadioButtonList1.Text = null;
        RadioButtonList2.Text = null;
        CheckBoxList1.Text = null;
        CheckBoxList2.Text = null;
    }
}

这篇关于WEB开发技术基础试题(ASP.NET)的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!