Author |
Topic  |
MammaRose
Starting Member
United States
32 Posts |
Posted - 28 November 2007 : 15:17:46
|
I am trying to install some code on my snitz forum for TNX.net to display links. I installed the Site Integration MOD and I want the links to show on the left side. I have added a line of code
<!-- #include file="banner1.asp" --> to inc_site_left.asp which calls the code given to me by TNX. File banner1.asp
<%@Language="JScript" %>
<!-- #include file="md5.asp" -->
...
However, I get an error that "The @ command must be the first command within the Active Server Page."
I have tried to contact TNX, but have gotten no answer. Anyone have any ideas? |
Cross Tattoos |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 November 2007 : 15:43:23
|
The language directives should be the first declarations on a page. There is a way to switch scripting languages, but I'm a little fuzzy on the particulars... could you link to a .txt copy of banner1.asp? It may help. |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 28 November 2007 : 17:35:14
|
I changed my file to banner1.txt and uploaded it.
Now the error is
banner1.txt, line 1
The @ command must be the first command within the Active Server Page. I don't understand, the first line of code in banner1 is <%@Language="JScript" %>, it is the first command.
|
Cross Tattoos |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 November 2007 : 18:10:29
|
don't use the .txt version, post a link to it here so we can see what the code is without the server trying to process it. |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 28 November 2007 : 18:11:19
|
Do you have any blank lines at the top? Is the file included by another asp page, making it's first line no longer the first line?
|
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 November 2007 : 18:45:56
|
Doug, he's got banner1.asp included in inc_site_left.asp so its not the first line of the page.
FWIW, I never really needed to switch scripting languages... I've always stuck with VBScript on the server-side. Having said that, I think all you will need to do is put the JScript code between <script runat="server" language="JScript"></script> instead of the <% %> you normally would. |
Edited by - AnonJr on 28 November 2007 18:47:10 |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 28 November 2007 : 20:42:02
|
quote: Originally posted by AnonJr
don't use the .txt version, post a link to it here so we can see what the code is without the server trying to process it.
Oh..oops, my bad. Here is the file http://www.sportsforumz.net/forum/ncaa/tennessee/forum/banner1.txt Do you need to see the code for md5.asp also? That is the page that banner1.asp includes, but the error I am getting is in banner1.asp |
Cross Tattoos |
Edited by - MammaRose on 28 November 2007 20:44:07 |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 November 2007 : 20:47:56
|
Is the include statement the only thing you have in inc_site_left.asp?
If it is, you can probably get away with just putting the following in inc_site_left.asp - otherwise, I'd replace the text in banner1.asp with this:
There may be some additional tweaking needed depending on the content of md5.asp
No guarantees... like I said earlier, I don't really mess with switching the scripting language. |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 28 November 2007 : 20:56:35
|
I added that code to inc_site_left and that got rid of the @ command error, but now I am getting an error on md5.asp.
Microsoft VBScript compilation error '800a0411'
Name redefined
/forum/ncaa/tennessee/forum/md5.asp, line 2
Private Const BITS_TO_A_BYTE=8 --------------^
Here is the code for md5 http://www.sportsforumz.net/forum/ncaa/tennessee/forum/md5.txt |
Cross Tattoos |
 |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 28 November 2007 : 22:13:30
|
Basically its telling you that you've already created a constant called "BITS_TO_A_BYTE" somewhere else in the program. Most likely its from including md5.asp in more than one place on the same page. If you've included md5.asp elsewhere in the forum, you won't need to add it to inc_site_left.asp |
 |
|
MammaRose
Starting Member
United States
32 Posts |
|
AnonJr
Moderator
    
United States
5768 Posts |
Posted - 29 November 2007 : 06:57:33
|
I'm seeing a "The system cannot locate the resource specified" error on both - which indicates that the page its pointing to doesn't exist. Is this the error you are referring to or is there a different one?
Also, are you including the md5.asp page in any other parts of the forum? |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 29 November 2007 : 09:50:59
|
Now using the computer at my work, I don't get an error on either of the links above. I am only including md5.asp from banner1.asp |
Cross Tattoos |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 30 November 2007 : 22:36:19
|
What file can I use #include to include a page that has @Language used so that I do not get the error that the @Language command must be the first on the page.
I have tried to add it to default.asp, inc_site_left.asp, inc_site_header.asp. thanks |
Cross Tattoos |
Edited by - MammaRose on 30 November 2007 22:37:34 |
 |
|
Doug G
Support Moderator
    
USA
6493 Posts |
Posted - 30 November 2007 : 23:30:54
|
quote: What file can I use #include to include a page that has @Language used so that I do not get the error that the @Language command must be the first on the page.
You can't do this include with traditional asp ssi includes. You might be able to use server.execute or server.transfer as a work-around. Easier would be to take the @Language statement out of the included page. |
====== Doug G ====== Computer history and help at www.dougscode.com |
 |
|
MammaRose
Starting Member
United States
32 Posts |
Posted - 30 November 2007 : 23:42:26
|
If I take the @Language statement out, then the script on the page will not run. Banner.asp is in javascript and I think Snitz has some VBScript. |
Cross Tattoos |
 |
|
Topic  |
|