| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi:
I have some questions regarding global.asa. I have a content management system, i edited the global.asa for it. But i want install other system and i dont understand how can i edit the global.asa if this system has other code (?). The first is VBscript, the second one is Jscript. Or can i install it in a subdomain? The firsr one ask the conecting string for DB, SQL etc, (easy for me) but the second global : is basically Code:
//DBConn
Application("SQL") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/DBConnection/SQL").text;
Application("dataPath") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/DBConnection/DSN").text;
Application("filePath") = Application("dataPath");
//MailReply
Application("MailUser") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/User").text;
Application("MailServer") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Server").text;
Application("MailAddress") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Address").text;
Application("MailPassword") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Password").text;
Application("Port") = parseInt(oXmlDoc.documentElement.selectSingleNode( "/SysConfig/MailReply/Port").text);
Application("Auth") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Auth").text;
Application("Subject") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Subject").text;
Application("Body") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/MailReply/Body").text;
//General
Application("LogoImg") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/General/Logo").text;
Application("HomePage") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/General/Homepage").text;
Application("Downloads") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/General/Downloads").text;
Application("ListSize") = parseInt(oXmlDoc.documentElement.selectSingleNode( "/SysConfig/General/MaxList").text);
Application("NewNews") = parseInt(oXmlDoc.documentElement.selectSingleNode( "/SysConfig/General/NewNews").text);
if (oXmlDoc.documentElement.selectSingleNode("/SysConfig/General/AutoMtr") != null)
Application("AutoMtr") = oXmlDoc.documentElement.selectSingleNode("/SysConfig/General/AutoMtr").text;
else
(note: when i put this global.asa in the root i have a message (missing ">") in the line 1 but the line 1 is ok (?)
<SCRIPT LANGUAGE=JScript RUNAT=Server>
Thank you Last edited by Shadow Wizard : February 13th, 2005 at 07:18 AM. Reason: added code tags - please do it yourself with [code] and [/code] tags next. |
|
#2
|
||||
|
||||
|
you can't mix vbscript and jscript in the same page like this, as far as I know.
|
|
#3
|
||||
|
||||
|
Correct, indeed you can't
![]() Its preferable to use <% instead of <script runat="server"> in ASP. (Likewise, Codebehind in ASP.Net is better than <script runat="server"> as well) Note that ASP ignores the language="" attribute of the <script runat="server"> element. You use the <%@ LANGUAGE="VBScript" %> directive to define the page language instead. If you omit the <%@ directive, then ASP by default assumes your page is written in VBScript. |
|
#4
|
||||
|
||||
|
Quote:
nope, you're wrong here Dude... you can have <script runat="server" language="JScript"> inside page with VBScript as the server side language. ![]() |
|
#5
|
||||
|
||||
|
Oh noes!
Has Captain ASP been proven wrong!??! this cannot be! ----- Tune in next time kids for the thrilling conclusion! |
|
#6
|
||||
|
||||
|
lol
don't you take it hard, you hear me? ![]() I'm not 100% sure you can have the <script language="JScript" runat="server"> in exactly the same page, but I'm 100% sure you can include it in VBScript ASP code as I'm doing it myself - I call JScript function from within VBScript code. ![]() |
|
#7
|
||||
|
||||
|
This is intriguing. Does my sidekick, ShadowWizardBoy, have any working examples of this?
|
|
#8
|
||||
|
||||
|
*ShadowBoy answer the challange!*
Code:
--GetMiliSecond.inc:
<script language="JScript" runat="server">
function getMiliSeconds() {
var now = new Date();
var miliSeconds = now.getTime();
return miliSeconds;
}
</script>
Code:
<% Option Explicit %> <!-- #include file="GetMiliSecond.inc" --> current mili seconds: <%=getMiliSeconds()%> ![]() |
|
#9
|
||||
|
||||
|
Seeming as SSIs are done before the ASP ISAPI, you can include <script runat="server"> with varying languages
T'would appear I was thinking of ASP.Net which only allows one language per page Hmmm, so thats why they put that down as a difference for ASP.Net "pages can only contain one language" |
|
#10
|
||||
|
||||
|
indeed. classic ASP also can, in theory, contain only one language on the same page but as you see there is way around. actually there is "way around" in ASP.NET as well by Importing page made with C# in VB page and you can call all its functions.
|
|
#11
|
||||
|
||||
|
That's different, thats calling the 'compiled' MSIL page and control classes
![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > Global.asa |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|