Sean
Posts: 39
|
| Posted: 07/09/2004, 12:42 PM |
|
I have one page that the Header (included) shows up at the bottom of the page, but it is the first thing in CodeCharge Studio on the page. What would cause this, or what can I do to find the problem?
Thanks.
|
 |
 |
Joe
|
| Posted: 07/09/2004, 7:02 PM |
|
Lets see some of your code...........
|
|
|
 |
Sean
Posts: 39
|
| Posted: 07/12/2004, 7:03 AM |
|
The page is an Include page. It is a separate ASP page (Event Calendar) that has its own HTML tags in it (which is where I suspect the problem is).
In CCS, I included the Header, and then have the other ASP page as a function in the same page. Everything works fine, but the header is at the bottom and the Event Calendar is at the top.
Any help will be greatly appreciated.
Ok, here is the code:
*************************************************************************
<%
Session.LCID = 2057
Function URL()
URL = Request.ServerVariable("URL")
End Function
Function DrawTheTestCalendar()
Dim disp_, extdisp_
disp_ = "" : extdisp_ = ""
dim SelectedDate,CurrentDate,mDate,fDate,nDex,strClass,dbRS,strELID
SelectedDate = Request.QueryString("SelectedDate")
CurrentDate = FormatDateTime(Now(),2)
If SelectedDate = "" Then SelectedDate = CurrentDate
%>
<html>
<head>
<title>Title Data Intranet</title>
<link rel="STYLESHEET" type="text/css" href="calStyle.css">
<script language="JavaScript">
function changeDate(newDate)
{
document.location.href = 'calList.asp?SelectedDate=' + newDate;
}
</script>
</head>
<body bgcolor="#FFFFFF"><center>
<table width="800" border="0" cellspacing="1" cellpadding="3">
<tr valign="top">
<td valign="bottom" class="Nav" nowrap align="left" onClick="document.location.href='testcalendar.asp?SelectedDate=<%=DateAdd("m",-1,SelectedDate)%>';">
<< Previous Month
</td>
<th width="800" class="MonthYear">
<%
If DateDiff("d",SelectedDate,CurrentDate) = 0 Then
Response.Write WeekDayName(WeekDay(SelectedDate)) & ", " & MonthName(Month(SelectedDate)) & " " & Day(SelectedDate) & ", " & Year(SelectedDate)
Else
Response.Write MonthName(Month(SelectedDate)) & ", " & Year(SelectedDate)
End If
%>
</th>
<td valign="bottom" class="Nav" nowrap height="25" align="right" onClick="document.location.href='testcalendar.asp?SelectedDate=<%=DateAdd("m",1,SelectedDate)%>';">
Next Month >>
</td>
</tr>
<tr height="100%">
<td colspan=3>
<table width="800" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #000066;">
<tr height="20" class="WeekDay">
<td>week</td>
<td width="14%">Sunday</td>
<td width="14%">Monday</td>
<td width="14%">Tuesday</td>
<td width="14%">Wednesday</td>
<td width="14%">Thursday</td>
<td width="14%">Friday</td>
<td width="14%">Saturday</td>
</tr>
<tr>
<%
mDate = DateSerial(Year(SelectedDate),Month(SelectedDate),1)
fDate = DateSerial(Year(SelectedDate),1,1)
Response.Write "<td height=""130"" class=""WeekNum"">" & DateDiff("ww",fDate,mDate) & "</td>"
For nDex = 1 to Weekday(mDate) - 1
Response.Write "<td height=""130"" class=""EmptyDays""> </td>"
Next
While (Month(mDate) = Month(SelectedDate))
If DateDiff("d",mDate,CurrentDate) = 0 Then
strClass = "CurDay"
Else
strClass = "Days"
End If
Set dbRS = DBTDI.Execute("SELECT * FROM EVENTS WHERE EDATE = FORMAT('" & mDate & "','MM/DD/YYYY')")
If NOT dbRS.EOF Then
Response.Write "<td height=""130"" valign=""top"" class=""" & strClass & """ onClick=""changeDate('" & mDate & "');"" onMouseOver=""window.status='" & WeekDayName(WeekDay(mDate)) & ", " & MonthName(Month(mDate)) & " " & Day(mDate) & ", " & Year(mDate) & "';"" onMouseOut=""window.status='';"">"
Response.Write Day(mDate)
While NOT dbRS.EOF
If dbRS.Fields("EPUBLIC").Value = True OR dbRS.Fields("ELID").Value = strELID Then
Response.Write "<div title=""" & dbRS.Fields("ELID").Value & """ class=""" & dbRS.Fields("ECLASS").Value & """>" & dbRS.Fields("EVENT").Value & "<div>"
End If
dbRS.MoveNext
Wend
Else
Response.Write "<td height=""130"" valign=""top"" class=""" & strClass & """ onClick=""changeDate('" & mDate & "');"" onMouseOver=""window.status='" & WeekDayName(WeekDay(mDate)) & ", " & MonthName(Month(mDate)) & " " & Day(mDate) & ", " & Year(mDate) & "';"" onMouseOut=""window.status='';"">" & Day(mDate) & "<div class=""EventBlank""> </div>"
End If
Response.Write "</td>"
If WeekDay(mDate) = 7 Then
Response.Write "</tr>"
End If
mDate = DateAdd("d", 1, mDate)
If WeekDay(mDate) = 1 AND (Month(mDate) = Month(SelectedDate)) Then
Response.Write "<tr><td class=""WeekNum"">" & DateDiff("ww",fDate,mDate) & "</td>"
End If
Wend
If Weekday(mDate) <> 1 Then
For nDex = Weekday(mDate) to 7
Response.Write "<td class=""EmptyDays""> </td>"
Next
End If
%>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<%
DrawTheTestCalendar = disp_
End Function
%>
|
 |
 |
peterr
Posts: 5971
|
| Posted: 07/12/2004, 5:52 PM |
|
The problem is that you're sending some output to the browser before the HTML template is being processed and shown.
Generally you should avoid the use of Response.Write, as this approach is not compatible with the template-based approach of CCS.
CCS sends all output to the browser at once by executing one Response.Write command. Therefore whatever you do before or after this happens, your Response.Write output can only be placed either at the top or at the bottom of the page.
Instead, you can place a Label on your page and then assign the custom output (Calendar) to it.
Alternatively, you could execute your code in the Before Unload of the page, which should execute it after the page is already shown, therefore it will appear at the bottom.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
 |
 |
Sean
Posts: 39
|
| Posted: 07/13/2004, 12:57 PM |
|
peterr,
Thanks for the suggestion. Before Unload worked perfectly. I was putting it in Before Show, but I guess that was the difference.
Much Appreciated!
Sean
|
 |
 |
|