|
主题: dw-mx中的重复域,好象只能向下重复,或者横向重复?
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#12004/4/5 10:22:46
我想这样重复,要怎么修改? 1,2,3,4 5,6,7,8 9,10,11,12 13,14,15,16 ……,……,……,…… ……,……,……,…… 一直重复下去!
|
 缺缺
职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
|
#22004/4/5 11:10:54
i = 1 while not(rs.eof or rs.bof) <td> %content% </td> if i mod 4 = 0 then Response.write("</tr><tr>") i=i+1 wend
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#32004/4/5 11:26:19
谢谢哥们! 我ASP不大明白。 这是我DW-MX生成的代码,看帮我改改,要在什么地方做修改! ———————————————————————————— <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> <!--#include file="Connections/conn.asp" -->
<% Dim Re_news Dim Re_news_numRows
Set Re_news = Server.CreateObject("ADODB.Recordset") Re_news.ActiveConnection = MM_conn_STRING Re_news.Source = "SELECT * FROM rw_news ORDER BY n_ID DESC" Re_news.CursorType = 0 Re_news.CursorLocation = 2 Re_news.LockType = 1 Re_news.Open()
Re_news_numRows = 0 %>
<% Dim Repeat1__numRows Dim Repeat1__index
Repeat1__numRows = 10 Repeat1__index = 0 Re_news_numRows = Re_news_numRows + Repeat1__numRows %> <% Dim MM_paramName %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone Dim MM_keepURL Dim MM_keepForm Dim MM_keepBoth
Dim MM_removeList Dim MM_item Dim MM_nextItem
' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" End If
MM_keepURL="" MM_keepForm="" MM_keepBoth="" MM_keepNone=""
' add the URL parameters to the MM_keepURL string For Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End If Next
' add the Form variables to the MM_keepForm string For Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End If Next
' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm If (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) End If If (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) End If If (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) End If
' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>无标题文档</title>
</head>
<body>
<table width="461" align="center"> <tr> <td>新闻</td> </tr>
<% While ((Repeat1__numRows <> 0) AND (NOT Re_news.EOF)) %> <tr> <td> <a href="new_xiangxi.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "n_ID=" & Re_news.Fields.Item("n_ID").value %>" title=<%=re_news.Fields.Item("n_biaoti").value%> target="_blank"> <% Dim CutShort CutShort = re_news.Fields.Item("n_biaoti").value if ( len(CutShort) > 16 ) then suibian= LEFT(CutShort, 16) & "..." else suibian= CutShort end if Response.Write( suibian ) %></a></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Re_news.MoveNext() Wend %> <tr> <td><div align="right"><a href="more_news.asp">更多新闻</a></div></td> </tr> </table> </table>
</BODY>
</body> </html> <% Re_news.Close() Set Re_news = Nothing %>
|
 缺缺
职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
|
#42004/4/5 11:30:57
<tr> <% While ((Repeat1__numRows <> 0) AND (NOT Re_news.EOF)) %> <td> <a href="new_xiangxi.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "n_ID=" & Re_news.Fields.Item("n_ID").value %>" title=<%=re_news.Fields.Item("n_biaoti").value%> target="_blank"> <% Dim CutShort CutShort = re_news.Fields.Item("n_biaoti").value if ( len(CutShort) > 16 ) then suibian= LEFT(CutShort, 16) & "..." else suibian= CutShort end if Response.Write( suibian ) %></a></td> <% if Repeat1__index mod 4 = 0 then Response.write("</tr><tr>") Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Re_news.MoveNext() Wend %> </tr>
记得把其他的行的单元格设为4列
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#52004/4/5 11:35:50
就这么简单?!我怎么想都想不出来,谢谢,我试试看,你用DW-MX做ASP吗? <% if Repeat1__index mod 4 = 0 then Response.write("</tr><tr>") Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 Re_news.MoveNext() Wend %>
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#62004/4/5 11:41:43
if Repeat1__index mod 4 = 0 then Response.write("</tr><tr>") 其中这个:("</tr><tr>") 怎么改啊?
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#72004/4/5 11:46:06
allinhands在上个帖子中说 引用: 记得把其他的行的单元格设为4列
什么意思啊? 我按照你所说的在加了一句:if Repeat1__index mod 4 = 0 then Response.write("</tr><tr>") 好象没有用啊?
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#82004/4/5 12:18:48
又测试了一下, 发现第一条他占了一行, 第二条开始倒是按照每行4条显示的, 为什么会这样啊?!
|
 缺缺
职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
|
#92004/4/5 12:54:57
if (Repeat1__index+1) mod 4 = 0 then Response.write("</tr><tr>")
</tr><tr>不需要改啊~
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#102004/4/5 12:56:01
又测试了一下, 发现第一条他占了一行, 第二条开始倒是按照每行4条显示的, 为什么会这样啊?!
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#112004/4/5 12:56:32
上课去了,等会儿再来
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#122004/4/5 15:49:29
怎么理解你说的: allinhands在上个帖子中说, “记得把其他的行的单元格设为4列 ”
|
 缺缺
职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
|
#132004/4/5 15:54:35
就是说比如这儿的: <tr>
<td><div align="right"><a href="more_news.asp">更多新闻</a></div></td>
</tr> 改成
<tr>
<td><div align="right" colspan="4"><a href="more_news.asp">更多新闻</a></div></td>
</tr>
|
 hxf3591126
职务:普通成员
等级:1
金币:1.0
发贴:176
注册:2002/2/2 11:08:57
|
#142004/4/5 18:32:46
又测试了一下, 发现第一条他占了一行, 第二条开始倒是按照每行4条显示的, 为什么会这样啊?!
|
 缺缺
职务:管理员
等级:8
金币:41.0
发贴:9620
注册:2004/1/14 19:14:47
|
#152004/4/5 20:28:58
hxf3591126在上个帖子中说 引用: 又测试了一下, 发现第一条他占了一行, 第二条开始倒是按照每行4条显示的, 为什么会这样啊?!
if (Repeat1__index+1) mod 4 = 0 then Response.write("</tr><tr>"  忘了Repeat1__index是从0开始的
|