Problem using a variable for a Theme name 
Author Message
 Problem using a variable for a Theme name

Dear all,

I thought this should be simple. I want to replace a hard-coded theme name
in the META tag on an ASP page with a variable. However if I do this the
Theme never loads in the browser. Using View Source shows the outputted HTML
meta tag appears to be identical to a working page.

I am assuming the Theme info is processed by the FP98 extensions on the web
server, and the relevant tags are then inserted into the outputted HTML. I
am guessing the problem is that the FP98 extensions are being processed
before it processes the ASP/VBScript code on the server, so the variable is
blank when it first gets to it.

Am I right? Anyone know a fix/workaround for this? ASP page code is
something like this:


<% CurrentTheme="RimaPrj1 001" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Microsoft Theme" content="<% =CurrentTheme %>"></head>
<title>... and so on

Using the same code with "RimaPrj1 001"  entered directly into the tag works
fine. Server is IIS3 on NT4/SP3 with latest FP98 extensions. Have tested
with both IE3.02 and IE 4.01Sp1 clients. Dev Tool is VID1.
I have also tried declaring the CurrentTheme as a Session variable in
global.asa with no joy.
--
Daniel (Remove x from email to reply directly)



Tue, 24 Jul 2001 03:00:00 GMT  
 Problem using a variable for a Theme name

Quote:

>Dear all,

>I thought this should be simple. I want to replace a hard-coded theme name
>in the META tag on an ASP page with a variable. However if I do this the
>Theme never loads in the browser. Using View Source shows the outputted
HTML
>meta tag appears to be identical to a working page.

Hi,

I haven't used themes myself, so this is speculation, but since the Theme
would (presumably) work on any browser, and since "Microsoft Theme" is not a
well-known META tag (and anyway, the client would have no idea what "RimaPrj
001" was), I would say it is processed by the server.

(I have a nagging suspicion - although it is no more than a suspicion - that
FrontPage resolves things like WebBots and Themes to straight HTML when you
publish the file to a web server. Is this correct?)

Have a look for other tags in the output HTML - such as <LINK REL="STYLE">
or just <STYLE>.  These are most likely generated on the fly by the server,
and provide Style Sheet information to the client. You should be able to
reverse-engineer these tags to convert them into parameterised tags based on
your ASP variables.

Also check if it modifies other tags in the document (eg with in-line styles
or formatting). In other words, get the source from a page that has been
generated "properly", and the source from a page that you tried to generate
with a variable name, and then compare the two (using, for example, WinDiff
which comes with Visual Studio (or maybe it's the Platform SDK?)).

Post the results (in some meaningful, summarised format!) if you can't
figure it out.

Peter

--
Peter Torr, Developer / Webmaster, Vantage Systems Australia.



Fri, 27 Jul 2001 03:00:00 GMT  
 Problem using a variable for a Theme name
The FP Themes META tag is definitely getting processed by the FP server
extensions BEFORE any ASP code. It also seems to evaluate the first one tag
it finds if there are more than one. To test this theory I tried:

<% dim ThemeName %>
<% ThemeName="Industrial" %>
<% Select case "ThemeName" %>
<%    case "Blueprint" %>
    <!-- Debug: Theme name should be <% =ThemeName %> -->
    <META name="Microsoft Theme" content="Blueprnt 001"></head>
<%    case "Industrial" %>
    <!-- Debug: Theme name should be <% =ThemeName %> -->
    <META name="Microsoft Theme" content="Indust 001"></head>
<%    case else %>
    <!-- Debug: Use no theme -->
    </head>
<% end select %>

This always loads the page with the "Blueprint" theme regardless of the
value of "ThemeName". The "<!-- Debug... " tag outputs correctly, so the ASP
logic is correct.

I also tried:
<% response.write "<META name=" & chr(34) & "Microsoft Theme" & chr(34) & "
content=" & chr(34) & "blueprnt 001" & chr(34) & "></head>"

This ensures the code is processed AFTER the ASP code on the page. However,
although this outputs the correct tag it does not get processed by the FP
extensions on the web server, and the style data is not added to the page.
The line is simply written to the HTML output with no affect on the page
formatting.

I noticed that when the theme META tag does work correctly it is completely
removed from the output HTML sent to the client.

Does anyone know if there is any real MS technical documentation on the FP
extensions, and particularly on the order server-side components like ASP
and FP extensions are processed in?

Can anyone suggest a fix/workaround for this?

--
Daniel (Remove x from email to reply directly)



Sun, 29 Jul 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. #Name? Problem using Public variables across Modules

2. Using variable to refer to variable name?

3. Using Variables for Field Names using .AddNew and .Update

4. Using variables for field names in recordset

5. Calling a procedure using a variable name

6. Define a column name using a variable

7. Using variables instead of field names

8. using a variable to specify field name in dlookup function

9. ODBC link in VBA using variable name

10. Call Let/Get Prop using string variable for name

11. Call Let/Get Prop using string variable for name

12. referencing field names using a variable

 

 
Powered by phpBB® Forum Software