موقعیت در صفحه .
مثلاً خط 23 باید مقدار متغیر چاپ بشه ولی همون متغیر در خط 85 مقدار دهی میشه و من باید همون مقداری که در خط 85 به متغیر نصبت داده شده رو چاپ کنم .
<%=x_CounterMSG %>
<form method="post">
<%
' Avoid starting record > total records
If CLng(nStartRec) > CLng(nTotalRecs) Then
nStartRec = nTotalRecs
End If
' Set the last record to display
nStopRec = nStartRec + nDisplayRecs - 1
' Move to first record directly for performance reason
nRecCount = nStartRec - 1
If Not rs.Eof Then
rs.MoveFirst
rs.Move nStartRec - 1
End If
nRecActual = 0
Do While (Not rs.Eof) And (nRecCount < nStopRec)
nRecCount = nRecCount + 1
If CLng(nRecCount) >= CLng(nStartRec) Then
nRecActual = nRecActual + 1
' Set row color
sItemRowClass = " class=""ewTableRow"""
sListTrJs = " onmouseover='ew_mouseover(this);' onmouseout='ew_mouseout(this);' onclick='ew_click(this);'"
' Display alternate color for rows
If nRecCount Mod 2 <> 1 Then
sItemRowClass = " class=""ewTableAltRow"""
End If
x_ID = rs("ID")
x_T_From_Username = rs("T_From_Username")
x_T_To_Username = rs("T_To_Username")
x_TSubject = rs("TSubject")
x_TDate = rs("TDate")
x_TTime = rs("TTime")
x_Tbody = rs("Tbody")
x_TView = rs("TView")
If x_T_To_Username = Session("MM_Username") Then
x_CounterMSG = x_CounterMSG + 1
%>
<table id="ewlistmain" class="ewTablemsg" DIR="RTL" width="80%" border="1" cellpadding="0" cellspacing="1" height="55">
<!-- Table body -->
<tr>
<!-- ID -->
<!-- T_From_Username -->
<td style="border-width:1; border-style:none;" bgcolor="#CDCDFF" valign="middle"> <div Style="float:right;">
<span><a href="<% If Not IsNull(x_ID) Then Response.Write "javascript:ajaxpage('Users_Contact_View_True.asp?ID=" & Server.URLEncode(x_ID)&"&x_TView=Yes&a_edit=u', 'main');" Else Response.Write "javascript:alert('Invalid Record! Key is null');" End If %>"><% If x_TView = False Then %><b><% Response.Write x_TSubject %></b><% Else
Response.Write x_TSubject
End If %></a><br>
</span><font color="#FF7174">[</font> <font size="2"><% Response.Write x_T_From_Username %>
</font> <font color="#FF7174">]</font>
</div>
<div Style="float:left;"><font size="2"><% Response.Write x_TDate %>
</font><font size="2"><br></font><font size="2"><% Response.Write x_TTime %></font></div></td>
<td width="50" style="border-width:1; border-style:none;" bgcolor="#CDCDFF" valign="middle"><span class="aspmaker"><a href="<% If Not IsNull(x_ID) Then Response.Write "javascript:ajaxpage('TblUsers_Countactdelete.asp?ID=" & Server.URLEncode(x_ID)&"', 'main');" Else Response.Write "javascript:alert('Invalid Record! Key is null');" End If %>">Delete</a></span></td>
<%
End If
End If
rs.MoveNext
Loop
%>
</table>
</form><%=x_CounterMSG%>
<% End If %>
<%
' Close recordset and connection
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
<html>
<head>
<body>
<span id="msg"></span>
<form method="post">
<%
' Avoid starting record > total records
If CLng(nStartRec) > CLng(nTotalRecs) Then
nStartRec = nTotalRecs
End If
' Set the last record to display
nStopRec = nStartRec + nDisplayRecs - 1
' Move to first record directly for performance reason
nRecCount = nStartRec - 1
If Not rs.Eof Then
rs.MoveFirst
rs.Move nStartRec - 1
End If
nRecActual = 0
Do While (Not rs.Eof) And (nRecCount < nStopRec)
nRecCount = nRecCount + 1
If CLng(nRecCount) >= CLng(nStartRec) Then
nRecActual = nRecActual + 1
' Set row color
sItemRowClass = " class=""ewTableRow"""
sListTrJs = " onmouseover='ew_mouseover(this);' onmouseout='ew_mouseout(this);' onclick='ew_click(this);'"
' Display alternate color for rows
If nRecCount Mod 2 <> 1 Then
sItemRowClass = " class=""ewTableAltRow"""
End If
x_ID = rs("ID")
x_T_From_Username = rs("T_From_Username")
x_T_To_Username = rs("T_To_Username")
x_TSubject = rs("TSubject")
x_TDate = rs("TDate")
x_TTime = rs("TTime")
x_Tbody = rs("Tbody")
x_TView = rs("TView")
If x_T_To_Username = Session("MM_Username") Then
x_CounterMSG = x_CounterMSG + 1
%>
<table id="ewlistmain" class="ewTablemsg" DIR="RTL" width="80%" border="1" cellpadding="0" cellspacing="1" height="55">
<!-- Table body -->
<tr>
<!-- ID -->
<!-- T_From_Username -->
<td style="border-width:1; border-style:none;" bgcolor="#CDCDFF" valign="middle"> <div Style="float:right;">
<span><a href="<% If Not IsNull(x_ID) Then Response.Write "javascript:ajaxpage('Users_Contact_View_True.asp?ID=" & Server.URLEncode(x_ID)&"&x_TView=Yes&a_edit=u', 'main');" Else Response.Write "javascript:alert('Invalid Record! Key is null');" End If %>"><% If x_TView = False Then %><b><% Response.Write x_TSubject %></b><% Else
Response.Write x_TSubject
End If %></a><br>
</span><font color="#FF7174">[</font> <font size="2"><% Response.Write x_T_From_Username %>
</font> <font color="#FF7174">]</font>
</div>
<div Style="float:left;"><font size="2"><% Response.Write x_TDate %>
</font><font size="2"><br></font><font size="2"><% Response.Write x_TTime %></font></div></td>
<td width="50" style="border-width:1; border-style:none;" bgcolor="#CDCDFF" valign="middle"><span class="aspmaker"><a href="<% If Not IsNull(x_ID) Then Response.Write "javascript:ajaxpage('TblUsers_Countactdelete.asp?ID=" & Server.URLEncode(x_ID)&"', 'main');" Else Response.Write "javascript:alert('Invalid Record! Key is null');" End If %>">Delete</a></span></td>
<%
End If
End If
rs.MoveNext
Loop
%>
</table>
</form>
<% End If %>
<%
' Close recordset and connection
rs.Close
Set rs = Nothing
conn.Close
Set conn = Nothing
%>
<script language="javascript">
document.getElementById("msg").innerHTML = "<%=x_CounterMSG%>" ;
</script>
</body>
</html>
<html>
<body>
<%
x_CounterMSG = 7
%>
<span id="msg"></span>
<script language="javascript">
document.getElementById("msg").innerHTML = "<%=x_CounterMSG%>" ;
</script>
</body>
</html>
آره درسته ....اما مشکل کجاست؟
ظاهرا" شما یک سری رکورد داری که میخوای اونها رو تو یک جدول چاپ کنی. تعداد رکوردها معلوم نیست و وقتی معلوم میشه که شما جدول رو چاپ کرده باشی. بالای جدول نیاز داری تعداد رکوردها رو چاپ کنی.
اگر تا اینجا درسته ادامه بدم.