Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 How do I make an include file collapsable ?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 September 2003 :  15:58:12  Show Profile
The title says it all - I have an include file at the inc_top which I would like to have the option to collapse/extent - is it possible? if yes, how?

Edited by - Nikkol on 04 September 2003 18:06:32

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 04 September 2003 :  16:22:49  Show Profile
what do you mean by collapse or extend? an include file is just that, it includes the contents of another file. If you mean you want the option of whether or not to include the file at all, then you would do something like:

<%
if someCondition = True then
%>
<!--#include file="somefile.asp"-->
<%
end if
%>

note that even doing this, the server must parse the code in the include whether or not it's contents are actually displayed.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

wii
Free ASP Hosts Moderator

Denmark
2632 Posts

Posted - 04 September 2003 :  16:26:23  Show Profile
Just the same way as default.asp shows the categories with the minus/plus icon, so people can choose which include file they want to have shown - not sure it´s possible...!?
Go to Top of Page

Nikkol
Forum Moderator

USA
6907 Posts

Posted - 04 September 2003 :  18:06:17  Show Profile
take a look at the code in Snitz then for the collapsing headers. I'm moving this to the correct forum.

Nikkol ~ Help Us Help You | ReadMe | 3.4.03 fixes | security fixes ~
Go to Top of Page

Doug G
Support Moderator

USA
6493 Posts

Posted - 04 September 2003 :  22:48:35  Show Profile
You can't programmatically decide what files to include. Included files are added in the code base for the page before any asp code is executed.

You can selectively execute included code using something like
<% if somecondition then %>
<!--#include file="somefile.asp"-->
<% end if %>

But the code from all files used this way are included, and if you have functions or subs, or declared variables of the same name in different include files your code will fail.

======
Doug G
======
Computer history and help at www.dougscode.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07