解决方案 »

  1.   

    <asp:content>下的
    <tr>标签外没有被<table>标签包含,当然会提示错误了
      

  2.   

    加了<table>还是一样显示错误呀。
      

  3.   

    <%@Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" Title="Untitled Page"%>
    <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <table>
        <tr>
            <td><table border="0" cellpadding="0" cellspacing="0" width="100%">
                     <tr onmouseout="this.style.backgroundColor='';" 
                        onmouseover="this.style.backgroundColor='lightcyan';">
                      <td align="center" height="30" 
                       style="border-bottom: 1px dashed #B7B7B7" class="style1" rowspan="2">
                      <%-- <asp:ImageMap ID="ImageMap1" runat="server" onclick="ImageMap1_Click" 
                           style="height: 16px" Width="16px">
                       </asp:ImageMap>--%>
                       <asp:Image ID="Image2" runat="server" ImageUrl="~/PIC/abnormal/1.bmp" /><br />
                       <hr />
                          
                        <asp:Image ID="Image1" runat="server" ImageUrl="~/PIC/crack/1.bmp"/><br />
                        <hr />
                        <asp:Image ID="Image3" runat="server" ImageUrl="~/PIC/joints/1.bmp" /><br />
                        &nbsp;<br />
                                       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                       
                                       
                         </td>
                      <td align="center" 
                      style="border-bottom: 1px dashed #B7B7B7; text-align:center">
                                   <asp:Repeater id="repeater1" runat="server" 
                                       onitemcommand="repeater1_ItemCommand">
                                    <ItemTemplate>
                                    <tr>
                                    <td>
                                        <%# ((KeyValuePair<string, string>)Container.DataItem).Key %>
                                        <%# ((KeyValuePair<string, string>)Container.DataItem).Value %>          
                                    </td>
                                    </tr>
                                    </ItemTemplate>
                                  
                                   </asp:Repeater>
                                   </td></tr>
                                       <tr>
                         <td align="center"> 
                        
                         <a href="<%# DataBinder.eval(Container,"DataItem.news_ncontent")%>" target="_blank"><asp:Button ID="Button1" runat="server" Text="下载" 
                          Font-Bold="True" Font-Size="Large" 
                          OnClientClick="return confirm('确定下载此文件吗?')" onClick="Button1_Click" 
                          PostBackUrl="~/Default.aspx"/></a>
                          </td>
                         </tr>
     
    </table>        </td>
        </tr>
        </table></asp:Content><asp:Content ID="Content2" runat="server" contentplaceholderid="head">    
        <style type="text/css">
            .style1
            {
                width: 568px;
            }
        </style>    
    </asp:Content>
    aspx.cs文件是这样写的,你看一下有什么问题不?
    using System;
    using System.Configuration;
    using System.Data;
    using System.Linq;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.HtmlControls;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Xml.Linq;
    using System.Data.SqlClient;
    using System.IO;
    using System.Collections;
    public partial class _Default : System.Web.UI.Page
    {
        //SqlConnection conn = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["dbConnectionString"].ToString());
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Request.QueryString.ToString() != "")
            //{
            //    string rqs = Request.QueryString["news_ID"];
            //    conn.Open();
            //    SqlCommand cmd = new SqlCommand();
            //    cmd.Connection = conn;
            //    cmd.CommandType = CommandType.Text;
            //    cmd.CommandText ="select [news_ncontent] from [news] where [news_ID] =‘" + rqs + "'";
            //    Page.DataBind();
            //    conn.Close();
            //}
            //else {
            //    Page.ClientScript.RegisterStartupScript(this.Parent.GetType(), "", "alert('请先选择您想观看的图片!');", true);
            //}
        }
      
        protected void repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            //int upload;
            
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            foreach (ListItem listItem in repeater1.Items) 
            {
                if (listItem.Selected) 
                {            }
            }
            Response.Write("下载成功!");    }
       
    }