Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

newbie question: ASP, HTML 1

Status
Not open for further replies.

magnus2

Programmer
Mar 8, 2004
23
SE
Will this work?

<noscript>
<% some ASP code %>
</noscript>

Or will the ASP code be carried out under all circumstances - i.e. also when HTML code between the tags would be ignored?

How can I otherwise make ASP dependent on HTML events?

Very grateful for comments!
 
To understand how HTML and ASP work together, think of it like this: Anything not inside <% %> tags effectively is inside <%Response.Write(this)%>.

That is, everything that's not inside ASP tags is just being Response.Written out.

HTML can't control anything in the ASP because it's just more ASP that writes out text, effectively.

If you want certain things to happen based on conditions you just need to surround things in If...Then...End If.

Make sense?
 
Thank you Genimuse and Bullschmidt for your time and answers!

But can I do something like this then?:

<%
If (Active scripting is turned off on the client computer)
Then
...
End If
%>

Hope one of you or someone else has some ideas! Thank you very much!
 
You cant knw if the user has or not Script enabled browser.
You can also find out somehow using some tricks.
But why would you need to find if the user has or not a Script enabled brwser?

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Thank you shaddow! I use som scripting statements in my HTML. But if the user has scripting turned off I want him to be redirected instead with no trace in history. Since this won't work:

<noscript>location.replace(...)</noscript>

I hope I can use ASP and <% Respons.redirect %> instead. I would be very much interested to learn more about the tricks you mention! Thank you for your comment!
 
Ok here it is then
Code:
testscript.htm

<meta http-equiv="refresh" content="5; url=http://www.example.com/noscript.asp"/>
<head>
<script language=javascript>
document.location="[URL unfurl="true"]http://www.example.com/withscript.asp"[/URL]
</script>
</head>

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
I'm not sure that this is what I need but maybe. Thanks! What is the exact workings of this code?:

<meta http-equiv="refresh" content="5; url=http://www.example.com/noscript.asp"/>

For me it is important that the redirecting web page will be omitted from the browser history folder - as is the case with location.replace and respons.redirect.

Thanks again!

I think maybe you gave me some good ideas in any case!
 
Well in this case you can use your location.replace in the javascript code side but for the non Script enabled browsers that meta tag will redirect them after 5 seconds at the noscript.asp page where you could do some non script based code.

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
[COLOR=yellow green]Off Topic[/color]

wsup.gif
Bullschmidt. I have not seen you around here for a while. Nice to see you again...


buffalo.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top