我做了一个前台界面,后台也都做好了。我调试程序,也没有报错,跟踪一下,都是正确的,但就是显示不出来界面,其中还包括图片。我在最后加了一句response.write("aaaaaaaaaaa"),他最后的这几个AAAAAAAAAAAAA就显示在最上面,其他的还是显示不出来。这是哪里的问题啊。都是DIV布局。

解决方案 »

  1.   

    是不是哪个控件的visible给弄成false了、。
      

  2.   

    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="onwenzhang.aspx.cs" Inherits="Main_onwenzhang" %><%@ Register Src="../usecontrol/tupian.ascx" TagName="tupian" TagPrefix="uc2" %><%@ Register Src="../usecontrol/wenzhang.ascx" TagName="wenzhang" TagPrefix="uc1" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <link href="../Main/personnews.css" rel="stylesheet" type="text/css" />
    <link href="../usecontrol/newpeoplenew.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../js/Time.js" /><html xmlns="http://www.w3.org/1999/xhtml" >
    <head  runat="server">
        <title>无标题页</title></head>
    <body>
        <form id="form1" runat="server">
        <div><div class="D1">
        
                 <div class="top"></div>
                 <div><img src="image/biao.gif" /></div>
                 <div class="biaotibutton">
                    <a href="javascript:kk1();" >|添加文章|</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                     &nbsp; &nbsp; &nbsp;&nbsp; |查看文章| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                     &nbsp; &nbsp; &nbsp; |返回主页|
                 </div>
                 <div class="daohang">
                     <asp:SiteMapPath ID="SiteMapPath1" runat="server">
                     </asp:SiteMapPath>
                 </div>
                 <div class="zhongall">          
                     <div class="zhongleft">
                         <div class="leftbaiti"> *他(她)发表的文章*</div><div class="leftneirong"><uc1:wenzhang ID="Wenzhang1" runat="server" /></div>
                         <div class="leftbaiti">*他(她)发表的图片主题 *</div><div class="leftneirong"><uc2:tupian ID="Tupian1" runat="server" /></div>
                     </div>
                     <div class="right" id="DIV1">
                        
                      <div class="zhenbiaoti" id="d1" runat="server"><asp:Label ID="Label1" runat="server" Text="Label" Width="549px"></asp:Label></div>
                     
                     <div class="zhenright" id="d2" runat="server">===================================================================<br />发表时间:<asp:Label ID="Label3" runat="server" Text="Label" Width="130px"></asp:Label></div>
                     <div class="zhenright" id="d3" runat="server"><asp:Label ID="Label2" runat="server" Text="Label" Width="549px"></asp:Label></div>
                     <div class="zhenright"></div>
                     </div>
                 </div>
               </div>
        
        </div>
        </form>
    </body>
    </html>
      

  3.   

    .D1
    {
    background-color:Transparent;
    width:850px;

    border-left:solid 1px RoyalBlue;
    border-right:solid 1px RoyalBlue;
      margin-left:auto;
        margin-right  :auto;
     
    }
      

  4.   

    .D1
    {
    background-color:Transparent;
    width:850px;

    border-left:solid 1px RoyalBlue;
    border-right:solid 1px RoyalBlue;
      margin-left:auto;
        margin-right  :auto;
     
    }
      

  5.   

    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;
    using System.IO;public partial class Main_onwenzhang : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {  IDAL.showwenzhang idalwz = new IDAL.showwenzhang();
            DLL.showwenzhang dllshow = new DLL.showwenzhang(idalwz);
            if (Request.QueryString["id"] == null)
            {
                idalwz.Id = Session["id"].ToString();        }
            else
            {
                idalwz.Id = Request.QueryString["id"];
            }
            dllshow.getmaxnum();
            if (Request.QueryString["writeid"] == null)
            {
                idalwz.Wrrtingid = idalwz.Maxid;        }
            else
            {
                idalwz.Wrrtingid = Request.QueryString["writeid"];
            }
            if (Request.QueryString["page"] == null)
            {
                idalwz.Page = "1";
            }
            else
            {
                idalwz.Page = Request.QueryString["page"];
            }
            idalwz.Writecontent = Server.MapPath("zhiliao/" + idalwz.Id + "/text/");
            dllshow.getwritte();
            if (idalwz.News == "0")
            {
                this.d1.Visible = false;
                this.d2.Visible = false;
                this.d3.Visible = false;
                Page.ClientScript.RegisterStartupScript(this.GetType(), "alter", "<script>alert('你没有发表文章');</script>");
                
            }
            else
            {            this.Label1.Text = idalwz.Them;
                this.Label3.Text = idalwz.Writtingtime;            this.Label2.Text = File.ReadAllText(idalwz.Writecontent, System.Text.Encoding.GetEncoding("GB2312"));
            }
            Response.Write("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        }    
    }
      

  6.   

    不看你这个代码,请把运行后的html代码帖出来
      

  7.   

    aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <link href="../Main/personnews.css" rel="stylesheet" type="text/css" />
    <link href="../usecontrol/newpeoplenew.css" rel="stylesheet" type="text/css" />
    <script language="javascript" src="../js/Time.js" /><html xmlns="http://www.w3.org/1999/xhtml" >
    <head><title>
    无标题页
    </title></head>
    <body>
        <form name="form1" method="post" action="onwenzhang.aspx?writeid=0002004&amp;id=0002" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjEzNDY3MjQyOA9kFgICAw9kFgoCAw9kFgICAQ88KwANAQAPFgYeC18hRGF0YUJvdW5kZx4JUGFnZUNvdW50AgEeC18hSXRlbUNvdW50AgRkFgJmD2QWDGYPDxYCHgdWaXNpYmxlaGRkAgEPZBYCZg9kFgICAQ8PFgQeC05hdmlnYXRlVXJsBS8uLi9tYWluL29ud2VuemhhbmcuYXNweD93cml0ZWlkPTAwMDIwMDEmaWQ9MDAwMh4EVGV4dAUa5rWL6K+VMDAwMueahOesrOS4gOS4qi4uLi5kZAICD2QWAmYPZBYCAgEPDxYEHwQFLy4uL21haW4vb253ZW56aGFuZy5hc3B4P3dyaXRlaWQ9MDAwMjAwMiZpZD0wMDAyHwUFDmZkYXNmYXNkZmEuLi4uZGQCAw9kFgJmD2QWAgIBDw8WBB8EBS8uLi9tYWluL29ud2VuemhhbmcuYXNweD93cml0ZWlkPTAwMDIwMDMmaWQ9MDAwMh8FBQ5xZXdycXdlcnF3Li4uLmRkAgQPZBYCZg9kFgICAQ8PFgQfBAUvLi4vbWFpbi9vbndlbnpoYW5nLmFzcHg/d3JpdGVpZD0wMDAyMDA0JmlkPTAwMDIfBQUi6K+l5q2755qE5rip5p+U5piv5Liq6ZSZ6K+v77yMLi4uLmRkAgUPDxYCHwNoZGQCBQ9kFgICAQ88KwANAQAPFgQfAGcfAmZkZAIHD2QWAmYPDxYCHwUFPOivpeatu+eahOa4qeaflOaYr+S4qumUmeivr++8jOW4jOacm+Wkp+WutuWlveWlveeahOiAg+iZkeS4gGRkAgkPZBYCAgEPDxYCHwUFEzIwMDctMTEtMjUgMjI6Mzc6MDBkZAILD2QWAmYPDxYCHwUFggJKYXZh6Z2i5ZCR5a+56LGh57yW56iL77yM6Z2i5ZCR5a+56LGh57yW56iL5ZKM6Z2i5ZCR6L+H56iL57yW56iL55qE5Yy65Yir77yM5oiR5Lus5aaC5L2V5omN6IO95o6M5o+h6Z2i5ZCR5a+56LGh55qE57yW56iL77yM57G75ZKM5a+56LGh55qE5YWz57O777yb6K6y6Kej5LqGSmF2YeS4reeahOaehOmAoOOAgemHjei9veOAgXRoaXPlkoxzdXBlcuWPmOmHj+OAgemdmeaAgeWPmOmHj+OAgUphdmHkuK3nmoTluLjph4/jgIHnu6fmib/jgIHlpJrmgIHjgIJkZBgCBRFUdXBpYW4xJEdyaWRWaWV3MQ9nZAUTV2VuemhhbmcxJEdyaWRWaWV3MQ9nZPL5aWLj6eK9xleKV0KYbhNM6AeM" />
    </div>    <div><div class="D1">
        
                 <div class="top"></div>
                 <div><img src="image/biao.gif" /></div>
                 <div class="biaotibutton">
                    <a href="javascript:kk1();" >|添加文章|</a> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                     &nbsp; &nbsp; &nbsp;&nbsp; |查看文章| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
                     &nbsp; &nbsp; &nbsp; |返回主页|
                 </div>
                 <div class="daohang">
                     <span id="SiteMapPath1"><a href="#SiteMapPath1_SkipLink"><img alt="跳过导航链接" height="0" width="0" src="/collageshow/WebResource.axd?d=gttKDiLxS8hGor9s-_eeKQ2&amp;t=633292109425000000" style="border-width:0px;" /></a><a id="SiteMapPath1_SkipLink"></a></span>
                 </div>
                 <div class="zhongall">          
                     <div class="zhongleft">
                         <div class="leftbaiti"> *他(她)发表的文章*</div><div class="leftneirong">
    <link href="../usecontrol/newpeoplenew.css" rel="stylesheet" type="text/css" />
    <div class="bb">
        <div>
    <table cellspacing="0" border="0" id="Wenzhang1_GridView1" style="color:#FF8080;background-color:Transparent;border-style:None;border-collapse:collapse;">
    <tr>
    <td>
                        <a id="Wenzhang1_GridView1_ctl02_HyperLink1" href="onwenzhang.aspx?writeid=0002001&amp;id=0002">测试0002的第一个....</a>
                    </td>
    </tr><tr>
    <td>
                        <a id="Wenzhang1_GridView1_ctl03_HyperLink1" href="onwenzhang.aspx?writeid=0002002&amp;id=0002">fdasfasdfa....</a>
                    </td>
    </tr><tr>
    <td>
                        <a id="Wenzhang1_GridView1_ctl04_HyperLink1" href="onwenzhang.aspx?writeid=0002003&amp;id=0002">qewrqwerqw....</a>
                    </td>
    </tr><tr>
    <td>
                        <a id="Wenzhang1_GridView1_ctl05_HyperLink1" href="onwenzhang.aspx?writeid=0002004&amp;id=0002">该死的温柔是个错误,....</a>
                    </td>
    </tr>
    </table>
    </div>
    </div>
    </div>
                         <div class="leftbaiti">*他(她)发表的图片主题 *</div><div class="leftneirong">
    <link href="../usecontrol/newpeoplenew.css" rel="stylesheet" type="text/css" />
    <div class="bb">
        <div></div>
    </div>
    </div>
                     </div>
                     <div class="right" id="DIV1">
                        
                      <div id="d1" class="zhenbiaoti"><span id="Label1" style="display:inline-block;width:549px;">该死的温柔是个错误,希望大家好好的考虑一</span></div>
                     
                     <div id="d2" class="zhenright">===================================================================<br />发表时间:<span id="Label3" style="display:inline-block;width:130px;">2007-11-25 22:37:00</span></div>
                     <div id="d3" class="zhenright"><span id="Label2" style="display:inline-block;width:549px;">Java面向对象编程,面向对象编程和面向过程编程的区别,我们如何才能掌握面向对象的编程,类和对象的关系;讲解了Java中的构造、重载、this和super变量、静态变量、Java中的常量、继承、多态。</span></div>
                     <div class="zhenright"></div>
                     </div>
                 </div>
               </div>
        
        </div>
        </form>
    </body>
    </html>
      

  8.   


    .D1 

    background-color:Transparent; 
    width:850px; border-left:solid   1px   RoyalBlue; 
    border-right:solid   1px   RoyalBlue; 
      margin-left:auto; 
            margin-right     :auto; 
      
    }貌似,你只设置了其width:850px; 
    而没有设置其height,所以该Div为默认的高度,所以不能完整的显示出你的内容.
    试试,加个height标签试试
      

  9.   

    从你的html代码上看是<script   language="javascript"   src="../js/Time.js"   /> 
    这里的毛病
    换种写法把
    <script   language="javascript"   src="../js/Time.js"   ></script> 
      

  10.   

    调用js文件的写法有问题<script language="javascript" src="../js/Time.js" />
    改成<script src="../js/Time.js" type="text/javascript"></script>这样试试吧