标题      发布时间                                             标题                 发布时间  
 信息标题信息标题信息标题信息标题  2008-7-5              信息标题信息标题信息标题信息标题  2008-7-5  
 
 信息标题信息标题信息标题信息标题  2008-7-5               信息标题信息标题信息标题信息标题  2008-7-5  
 
 信息标题信息标题信息标题信息标题信息标题  2008-7-5          信息标题信息标题信息标题信息标题信息标题  2008-7-5 
 
 信息标题信息标题信息标题信息标题信息标题  2008-7-4         信息标题信息标题信息标题信息标题信息标题  2008-7-4  
 
 信息标题信息标题信息标题信息标题信息标题  2008-7-4           信息标题信息标题信息标题信息标题信息标题  2008-7-4 实现功能如上:新闻两栏如何用asp.net c#实现请教高手 都是来自同一个表,用datalist GridView还是其它方法?高手来呀

解决方案 »

  1.   

    这种情况的话,可以用两个GridView来显示。把两个GridView(GridView1、GridView2)并排放在网页上。在从数据库中读取记录的时候,把记录分成两部分,分别放到不同的DataSet(DataSet1、DataSet2)中,然后将DataSet1绑定到GridView1,DataSet2绑定到GridView2。这样可以实现你要的效果。
      

  2.   

    GirdView or DataList....都可以
    楼上的帮你解决了。。
      

  3.   

    <ul>
    <li class="title">信息标题信息标题信息标题信息标题信息标题</li>
    <li class="date">2008-7-4</li>
    .....
    </ul>style样式设置方法如下:ul的宽度设置为title+date宽度的两倍多一点,
    title的宽度和date的宽度,根据你需要进行设置
    如果要对越长的内容,自动启用 "..."的,也可以设置在style中.效果可以打开:www.chnair.net,里面点开随便一条新闻,新闻正文下面的"相关链接"
    http://www.chnair.net/news/show.aspx?id=21161style具体写法可参照
    .link-list{clear:both; display:inherit; line-height:25px;}
    .link-list .caption{width:680px; height:25px; color:Black;margin:10px 10px 10px 10px; background:#EBEBEB; text-align:left; font-weight:bold; font-size:14px; text-indent:1pc}
    .link-list  li{clear: none; float: left; width: 270px; background: url(skin/s_d2.gif) no-repeat 0 -14px ;display:inline-block ;overflow: hidden;white-space: nowrap;text-overflow:ellipsis;-o-text-overflow: ellipsis;text-indent:5px; margin-left:20px}
    .link-list .date {width:50px; float:left; display:block;  background:none; margin:0px; text-indent:0px}

    aspx中程序如下:
    <div class="link-list">
        <ul>
            <li class="caption">相关链接</li>
            <asp:Repeater ID="rptLink" runat="server">
            <ItemTemplate><li><a href="<%# Eval("href")%>" title="<%#Eval("title")%>" target="_blank"><%#Eval("title")%></a></li><li class="date">[<%#Eval("createDate", "{0:MM/dd}")%>]</li>
    </ItemTemplate></asp:Repeater>    </ul>
        <div class="blank3" style="margin:1px:auto"></div>
        <p class="row10" style=" margin:10px auto; width:690px"></p>
    </div>
      

  4.   

    DataList 有个属性 RepeatColumns =2
      

  5.   

    DataList 有个属性 RepeatColumns =2
      

  6.   

    楼上的已经答的很清楚了,用datalist 吧
      

  7.   

     用datalist
    RepeatDirection="horizontal" 设置横向显示记录
    RepeatColumns="2" 设置每行显示上记录
      

  8.   

    干嘛要用2个gridview?一个datalist就搞定了,又不需要分页。
      

  9.   

    用datalist 然后分两列显示;
    具体代码如下:
    <%@ Page Language="C#" AutoEventWireup="true" CodeFile="DuBug.aspx.cs" Inherits="DuBug" %><!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>
    <title>官网欢迎您!</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link href="cssANDjs/mystyle.css" rel="stylesheet" type="text/css">
    </head><body topmargin="0" leftmargin="0" bgcolor="#ffffff">
    <form id="form1" runat="server">
    <table width="726" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><img src="images/websiteimage/righttable5title.gif" width="164" height="26" align="absbottom" /></td>
      </tr>
      <tr>
        <td height="42" align="center" valign="bottom" background="images/websiteimage/bugbg1.jpg"><table width="670" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="358" height="35" valign="bottom">&nbsp;<img src="images/websiteimage/bugitem1.gif" width="80" height="26" align="absbottom" />&nbsp;&nbsp;<a href="DuBug2.aspx"><img src="images/websiteimage/bugitem2b.gif" width="80" height="26" border="0" align="absbottom" /></a>&nbsp;&nbsp;<a href="DuBug3.aspx"><img src="images/websiteimage/bugitem3b.gif" width="70" height="26" border="0" align="absbottom" /></a>&nbsp;&nbsp;<a href="DuBug4.aspx"><img src="images/websiteimage/bugitem4b.gif" width="70" height="26" border="0" align="absbottom" /></a></td>
            <td width="312">
                <asp:ValidationSummary ID="ValidationSummary1" runat="server" ShowMessageBox="True"
                    ShowSummary="False" ValidationGroup="1a" />
                &nbsp;<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
                    ControlToValidate="TextBox1" Display="None" ErrorMessage="搜索内容:请输入1-20个字符" ValidationExpression="^(.){1,22}$"
                    ValidationGroup="1a"></asp:RegularExpressionValidator>
                <asp:TextBox ID="TextBox1" runat="server" Width="150px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
                    Display="None" ErrorMessage="搜索关键字不能为空" ValidationGroup="1a"></asp:RequiredFieldValidator>1<asp:ImageButton
                        ID="ImageButton1" runat="server" ImageUrl="images/websiteimage/bugbtn1.gif" OnClick="ImageButton1_Click"
                        ValidationGroup="1a" />
                &nbsp;<asp:ImageButton ID="ImageButton2" runat="server" CausesValidation="False"
                    ImageUrl="images/websiteimage/bugbtn2.gif" OnClick="ImageButton2_Click" PostBackUrl="~/Bgsubmit.aspx" /></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td height="126" align="right" valign="top" background="images/websiteimage/bugbg2.jpg" style="text-align: center" >
            <table border="0" cellpadding="0" cellspacing="0" width="680">
                <tr align="left">
                    <td class="darkred" colspan="4" rowspan="6" valign="top">
                        <asp:DataList BorderWidth="0px" DataKeyField="BUGQusetionID" ID="DataList1" OnItemDataBound="DataList1_ItemDataBound" RepeatColumns="2" RepeatDirection="Horizontal" runat="server" ShowFooter="False">
            <ItemTemplate>
                <table border="0" cellpadding="0" cellspacing="0" id="content" width="340">
                    <tr align="left">
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: left">
                            &nbsp; ·
                            <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("BUGQusetionID","BgAnswtion.aspx?ID={0}") %>'
                                Target="_blank" Text='<%# Eval("BUGQuestion") %>'></asp:HyperLink></td>
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: right">
                            &nbsp;<asp:Label ID="Label2" runat="server"></asp:Label>&nbsp;
                        </td>
                    </tr>
                </table>
            </ItemTemplate>
            <HeaderTemplate>
                <table id="Table1" border="0" cellpadding="3" cellspacing="0" width="680">
                    <tr align="left">
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: left">
                            &nbsp; &nbsp; &nbsp;&nbsp; 标题</td>
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: right">
                            状态 &nbsp;&nbsp;
                        </td>
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: left">
                            &nbsp; &nbsp;&nbsp; &nbsp;标题</td>
                        <td class="darkred" colspan="2" rowspan="6" style="text-align: right">
                            状态 &nbsp; &nbsp;</td>
                    </tr>
                </table>
            </HeaderTemplate>
        </asp:DataList></td>
                </tr>
            </table>
        </td>
      </tr>
      <tr>
        <td height="35" align="right" background="images/websiteimage/bugbg3.jpg"><font color="#FF0000"><a href="BgQuAriticle.aspx" target="_blank">更多问题 &gt;&gt;</a></font>&nbsp;&nbsp;&nbsp;</td>
      </tr>
    </table>
    </form>
    </body>
    </html>
      

  10.   

    使用datalist或者gridview
    按照你的爱好来!!!
      

  11.   

    js Tab+两个datalist可以实现新闻频道来回却换
      

  12.   

    如果不想用DataGrid,GridView,DataList或Repeater的,也许下面这个影片,多少能给你一些参考:http://download.csdn.net/source/377420
      

  13.   

    15楼比较详细点,其它人用Datalist也是对的,3楼的方法尝试我没成功!OK谢谢了所有回复的人!!!