每排超过1? [英] more than 1 per row?

查看:65
本文介绍了每排超过1?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿帮派。

我知道这可能是一个简单的解决方案,但我不记得怎么做了。


我有这个代码;


<%

如果rstActiveUsers.RecordCount 0那么

rstActiveUsers.MoveFirst

Do While Not ThirstActiveUsers.EOF

var_user1 = session(" username")%>

< td class =" tdblock" align =" left">

< font color =" #FFFFFF" style =" font-size:

9pt"><%= var_user1%>< / font>< / td>

< / tr> ;

<%rstActiveUsers.MoveNext

循环

结束如果

%>


它显示这样的名字;


name1

name2

name3


我想要它做什么,就像这样展示,有3个对面


name1 name2 name3


i think我记得用一个mod或者其他东西把它拉下来。


有人可以帮忙吗?


TIA

杰夫

Hey gang.
I know this is probably an easy solution, but I don''t remember how to do it.

I have this code;

<%
If rstActiveUsers.RecordCount 0 Then
rstActiveUsers.MoveFirst
Do While Not rstActiveUsers.EOF
var_user1 = session("username") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_user1%></font></td>
</tr>
<% rstActiveUsers.MoveNext
Loop
End If
%>

it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.

can someone help??

TIA
Jeff

推荐答案



" Jeff" < ba*@gig-gamers.com写信息

news:45 *********************** @ roadrunner.com ...

"Jeff" <ba*@gig-gamers.comwrote in message
news:45***********************@roadrunner.com...

嘿帮派。

我知道这可能是一个简单的解决方案,但我不记得该怎么办

it。


我有这个代码;


<%

如果rstActiveUsers.RecordCount 0然后

rstActiveUsers.MoveFirst

Do while Not ThirstActiveUsers.EOF

var_user1 = session(" username")%>

< td class =" tdblock" align =" left">

< font color =" #FFFFFF" style =" font-size:

9pt"><%= var_user1%>< / font>< / td>

< / tr> ;

<%rstActiveUsers.MoveNext

循环

结束如果

%>


它显示这样的名字;


name1

name2

name3


我想要它做什么,就像这样展示,有3个对面


name1 name2 name3


i think我记得用一个mod或者其他东西把它拉下来。


有人可以帮忙吗?


TIA

杰夫
Hey gang.
I know this is probably an easy solution, but I don''t remember how to do
it.

I have this code;

<%
If rstActiveUsers.RecordCount 0 Then
rstActiveUsers.MoveFirst
Do While Not rstActiveUsers.EOF
var_user1 = session("username") %>
<td class="tdblock" align="left">
<font color="#FFFFFF" style="font-size:
9pt"><%=var_user1%></font></td>
</tr>
<% rstActiveUsers.MoveNext
Loop
End If
%>

it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.

can someone help??

TIA
Jeff



好​​了,还有这个,我以为我在global.asa上工作了,但它不是b $ b。


i在asa文件中有这个:


< object runat =" Server" scope =" Application"

id =" rstActiveUsers" progid =" ADODB.Recordset">

< / object>


< script language =" VBScript" runat =" Server">


Sub Application_OnStart()


Const adInteger = 3

Const adVarChar = 200

Const adDate = 7

rstActiveUsers.Fields.Append" id",adInteger

rstActiveUsers.Fields.Append " ip",adVarChar,15

rstActiveUsers.Fields.Append" browser",adVarChar,255

rstActiveUsers.Fields.Append" started",adDate


rstActiveUsers.Open

End Sub


Sub Session_OnStart()


Session.Timeout = 20


会话(开始)=现在()


如果不是rstActiveUsers.EOF那么rstActiveUsers.MoveLast


rstActiveUsers.AddNew

rstActiveUsers.Fields(" id")。值= _

会话。 SessionID


rstActiveUsers.Fields(" ip")。Value = _

Request.ServerVariables(" REMOTE_HOST")

>
rstActiveUsers.Fields(" browser")。Value = _

Request.ServerVariables(" HTTP_USER_AGENT")

rstActiveUsers.Fields(" started" ).Value = _

现在()


rstActiveUsers.Update


End Sub
< br $>
Sub Session_OnEnd()


Const adSearchForward = 1

Const adBookmarkFirst = 1

Const adAffectCurrent = 1


rstActiveUsers.Find" id =" &安培; Session.SessionID,_

0,adSearchForward,adBookmarkFirst


如果不是rstActiveUsers.EOF那么

rstActiveUsers.Delete adAffectCurrent

结束如果

结束子


子Application_OnEnd()

rstActiveUsers.Close

结束子

< / script>

现在我没有,我无法弄明白,是如何得到实际的/>
会话用户名。


i将cookie值作为会话(用户名),但我不确定在哪里将
放入。我已经搜索了通常的教程地点,但我没有看到

来获取该信息。


如果有人可以提供帮助,我将不胜感激。

至少指出我能找到的地方。

ok, along with this, i thought i had this working in the global.asa, but it
isn''t.

i have this in the asa file:..

<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>

<script language="VBScript" runat="Server">

Sub Application_OnStart()

Const adInteger = 3
Const adVarChar = 200
Const adDate = 7

rstActiveUsers.Fields.Append "id", adInteger
rstActiveUsers.Fields.Append "ip", adVarChar, 15
rstActiveUsers.Fields.Append "browser", adVarChar, 255
rstActiveUsers.Fields.Append "started", adDate

rstActiveUsers.Open
End Sub

Sub Session_OnStart()

Session.Timeout = 20

Session("Start") = Now()

If Not rstActiveUsers.EOF Then rstActiveUsers.MoveLast

rstActiveUsers.AddNew

rstActiveUsers.Fields("id").Value = _
Session.SessionID

rstActiveUsers.Fields("ip").Value = _
Request.ServerVariables("REMOTE_HOST")

rstActiveUsers.Fields("browser").Value = _
Request.ServerVariables("HTTP_USER_AGENT")

rstActiveUsers.Fields("started").Value = _
Now()

rstActiveUsers.Update

End Sub

Sub Session_OnEnd()

Const adSearchForward = 1
Const adBookmarkFirst = 1
Const adAffectCurrent = 1

rstActiveUsers.Find "id = " & Session.SessionID, _
0, adSearchForward, adBookmarkFirst

If Not rstActiveUsers.EOF Then
rstActiveUsers.Delete adAffectCurrent
End If
End Sub

Sub Application_OnEnd()
rstActiveUsers.Close
End Sub
</script>
now what i don''t have, and am unable to figure out, is how to get the actual
session usernames.

i have the cookie values as session("username") but i am unsure of where to
put that. i have searched the usual tutorial places, but i don''t see where
to get that info.

if anyone can help, i would appreciate it.
at least point me to where i can find this.


Jeff写道:
Jeff wrote:

< object runat =" Server" scope =" Application"

id =" rstActiveUsers" progid =" ADODB.Recordset">

< / object>
<object runat="Server" scope="Application"
id="rstActiveUsers" progid="ADODB.Recordset">
</object>



糟糕......没有...可怕的想法。除非您修改了服务器的注册表以标记它们,否则不要将ADO对象存储在应用程序或

会话中

" free-threaded" (这意味着它们不能用于Jet)
http://www.aspfaq .com / 2053


使用数组或自由线程的XML文档。

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

没有垃圾邮件

Bad ... no ... HORRIBLE idea. Do NOT store ADO objects in application or
session unless you have modified the server''s registry to mark them
"free-threaded" (which will mean they cannot be used for Jet)
http://www.aspfaq.com/2053

Use an array or free-threaded XML document instead.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


Jeff写道:
Jeff wrote:

<%

如果rstActiveUsers.RecordCount 0那么
<%
If rstActiveUsers.RecordCount 0 Then



我希望这个记录集断开连接关闭...

I hope this recordset is disconnected and the connection closed ...


它显示这样的名字;


name1

name2

name3


我想要它做什么,就像这样显示,有3个


name1 name2 name3


i我想我会记得使用mod或其他东西来解决这个问题。
it shows names like this;

name1
name2
name3

what i would like it to do, is show like this, with 3 across

name1 name2 name3

i think i remember using a mod or something to pull this off.



看看,你在ASP代码中所做的一切正在生成一串html

个字符。考虑到这一点,首先要创建一个可以根据需要显示数据的HTML。然后修改vbscript代码以生成

那个html。


在这种情况下,不要在每个之后写单元格和行结束并开始标记

记录,你可以在一定数量的记录后写下它们。是的,你可以

使用mod来做到这一点:

如果recordsprocessed%3 = 0那么

''写结束和开始标记

结束如果

''写入数据


Bob Barrows

-

Microsoft MVP - ASP / ASP.NET

请回复新闻组。这个电子邮件帐户是我的垃圾邮件陷阱所以我

不经常检查它。如果您必须离线回复,请删除

无垃圾邮件

Look, all you are doing in ASP code is generating a string of html
characters. With that in mind, start by creating the hetml that would
display the data as you desire. Then modify the vbscript code to generate
that html.

In this case, instead of writing cell and row end and start tags after each
record, you would write them after a set number of records. Yes, you could
use mod to do this:
if recordsprocessed % 3 =0 then
''write the end and beginning tags
end if
''write the data

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don''t check it very often. If you must reply off-line, then remove the
"NO SPAM"


这篇关于每排超过1?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆