<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ import Namespace="System.Data" %>
<%@ import Namespace="System.Data.SqlClient" %>
<!--#include file="head.inc"-->
<!--#include file="common.inc"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
.style1 {
font-size: 24px;
color: #669900;
font-weight: bold;
}
.style4 {font-size: 18px}
.style6 {font-size: 14px}
.STYLE8 {
font-size: 14px;
color: #006666;
font-weight: bold;
}
-->
</style>
</head>
<script runat="server">
   Sub xscx()
     xscx.DataSource = CreateDataSet("select kq_id as 考勤号,stu_name as 姓名 ,kq_date as 日期, keshi as 课时,Course_name           as 课程名 ,kq_name1 as 考勤情况,kq_name2 as 考勤情况,kq_name3 as  考勤情况  from tblstudent,tblcourse,kq where                 tblstudent.stu_id=kq.stu_id and kq.course_id=tblcourse.course_id and tblestudent.stu_name=xm.text","kq")
xscx.DataBind()
End Sub
Sub Grid_Select1(Sender As Object, E As EventArgs)
   filterValue = CStr(xscx.DataKeys(xscx.SelectedIndex)).Replace("'", "''")
   response.redirect("xscx.aspx?id=" & filterValue)
End Sub</script>
<body>
<form action="" method="post" name="form1" runat="server">
  <table width="974" height="401" border="0">
    <tr>
      <td height="28"><div align="center"><span class="style1 style4">学生个人考勤查询</span></div></td>
    </tr>
    <tr>
      <td height="23"><div align="center"><span class="STYLE8">姓名:</span>
          <asp:TextBox ID="xm" runat="server" />
          <asp:Button ID="cx" Text="查询" OnClick="xscx" runat="server"  />
      </div>      </td>
    </tr>
    <tr>
      <td><asp:DataGrid ID="xscx" runat="server"></asp:DataGrid>&nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>

解决方案 »

  1.   

    <script runat="server">代码放在<head>块里面看看行不行
      

  2.   


    删掉下面的试试看(都删掉或其一):
    <%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
      

  3.   

    把这个删除了<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    只显示文字不显示控件,把都删除了又只显示代码了
      

  4.   

    把<script runat="server">代码放在<head>块里面,还是一样的
      

  5.   

    <script runat="server">
    <head>代码放在</head>
      

  6.   

    把<script runat=server></script>替换成<%%>