日期:2014-05-16  浏览次数:20480 次

急!!!老师布置的考题不会 马上要考试了 求各位高手说说答案 在线等待
asp.net
@Control指令用于定义__________的特定属性。(   )
A). 服务器控件    B)客户端控件   C)用户控件   D)组件 


1.  要求:只在页面初次加载时,在页面中显示Hello World
private void Page_Load(object sender,System.EventArgs e)
 {
   if(________________)
{
  this.Response.Write(“Hello World!”);
}
    }


2. 要求:在页面上输出相应内容
private void Page_Load(object sender, System.EventArgs e)
{
for(int i=0;i<5;i++)
           {
string shtml=string.Format(“<center><font size={0}>Hello world</font><br></center>”,i);
this.Page.Response._________(shtml);
            }
}


3.要求:使用Form数据集合,向服务器提交表单数据
C#源代码
   void Page_Load(object Sender,EventArgs E)
   {
     string name;
     string age;
     name=Request.Form[“name”];
     age=Request._________.[“age”];
     message.Text=”<br><br>你提交的信息是:<br><br>姓名=”+name+”<br>年龄=”+age;
}
   HTML代码
<html>   
<head id=”Head1” runat=”server”>
     <title>使用Form数据集合</title>
</head>
<body>
      <form id =”form1” runat=”server”>
         姓名:<asp:TextBox id=”name” runat=”server”></asp:TextBox><br/>
         年龄:<asp:TextBox id=”age” runat=”server”></asp:TextBox><br/>
               <asp:Label id=”message” runat=”server”></asp:Label>
</form>
</body>
</html>


4. 要求:使用Application对象,实现站点计数器
           void Page_Load(object Sender,EventArgs E)
           {
Application.________;
Application[“count”]=Convert.ToInt32(Application[“count”])+1;
Application.UnLock();
Label1.Text=”欢迎光临,您是本站第”+Convert.ToString(Application[“count”])+”位客人。”;
}

1. 现有一个数据库Student,其中包含学生信息表Stu,表中分别有字段:StuNum(学号),StuName(姓名),StuBirth(出生日期)
请写出,通过代码实现访问Student数据库的数据表Stu时,所要创建的对象及相应的代码




------解决方案--------------------
你上课都干啥子了

@Control指令用于定义__C_______的特定属性。(   )
A). 服务器控件    B)客户端控件   C)用户控件   D)组件 


1.  要求:只在页面初次加载时,在页面中显示Hello World
private void Page_Load(object sender,System.EventArgs e)
 {
   if(!IsPostBack)
{
  this.Response.Write(“Hello World!”);
}
    }


2. 要求:在页面上输出相应内容
private void Page_Load(object sender, System.EventArgs e)
{
for(int i=0;i<5;i++)
           {
string shtml=string.Format(“&