473,651 Members | 3,049 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ASP editing .js file

I have a .js menu file that runs in all of my intranet
files. I have an asp calendar system where I can add
calendar names to a db and it will display these new
calendars. What I don't have is a good way to edit my .js
menu file to add a new menu item.

Can fso add a line to a .js file that is "live" on an
intranet or will it run into file locks? by iis??

I am writing the code to try it now but I thought I would
ask.

Thanks
Mike
Jul 19 '05 #1
7 4013
it should be able to. IIS reads it in then closes it. You should be able to
open it, write to it, close it fairly quickly.
Just be careful though. Many browsers will cache the .JS file I believe so
even after a change you may not see the changes on the clients/browsers
right away.
--
Curt Christianson
Owner/Lead Developer, DF-Software
Site: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Mike D" <an*******@disc ussions.microso ft.com> wrote in message
news:0e******** *************** *****@phx.gbl.. .
I have a .js menu file that runs in all of my intranet
files. I have an asp calendar system where I can add
calendar names to a db and it will display these new
calendars. What I don't have is a good way to edit my .js
menu file to add a new menu item.

Can fso add a line to a .js file that is "live" on an
intranet or will it run into file locks? by iis??

I am writing the code to try it now but I thought I would
ask.

Thanks
Mike

Jul 19 '05 #2
Curt_C [MVP] wrote on 05 aug 2004 in
microsoft.publi c.inetserver.as p.general:
Just be careful though. Many browsers will cache the .JS file I
believe so even after a change you may not see the changes on the
clients/browsers right away.


If you have trouble with the .js caching, why not just insert the file ASP-
wize:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.js"-->
</script>

You can even specigy the expiry in the js file by specifying it as
<% Response.Expire s = 1 %> so:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #3
Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?

Mike

-----Original Message-----
Curt_C [MVP] wrote on 05 aug 2004 in
microsoft.publ ic.inetserver.a sp.general:
Just be careful though. Many browsers will cache the .JS file I believe so even after a change you may not see the changes on the clients/browsers right away.
If you have trouble with the .js caching, why not just

insert the file ASP-wize:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.js"-->
</script>

You can even specigy the expiry in the js file by specifying it as<% Response.Expire s = 1 %> so:

<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.

Jul 19 '05 #4
Mike D wrote on 06 aug 2004 in microsoft.publi c.inetserver.as p.general:
Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?


Are these contradictory?
<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>


This is not a virtual folder,
just a virtual specification of a very real folder,
"relative" to the web root. A virtual path!

The advantage over a relative include is, that you can change the
"includer's " path/location while path to the included file remains valid.

[please do not toppost when replying on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #5
-----Original Message-----
Mike D wrote on 06 aug 2004 in microsoft.publi c.inetserver.as p.general:
Thanks for the reply I have not used virtual includes
before. I there an advantage to putting all of my
includes in a virtual folder? Or do you maintain your
includes in the web?


Are these contradictory?
<script style="text/javascript">
<!--#include virtual ="/lib/myJs.asp"-->
</script>


This is not a virtual folder,
just a virtual specification of a very real folder,
"relative" to the web root. A virtual path!

The advantage over a relative include is, that you can

change the"includer's " path/location while path to the included file remains valid.
[please do not toppost when replying on usenet]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
.


If I have a path Myweb/Includes I can add an include file
using

<script type="text/javascript" language="JavaS cript"
src="Includes/MenuLib.js"></script>

but I can't use the virtual syntax (these are copied from
different levels)

<!--#include virtual ="/../../Includes/MenuLib.js"-->

If I add a new Virtual Directory and point it to the
includes pathe it still can't find the file but if I make
a new folder outside of the web structure and point to
that with a virtual directory the page can be found.??

Make sense?

Mike
Jul 19 '05 #6
Mike D wrote on 06 aug 2004 in microsoft.publi c.inetserver.as p.general:
<!--#include virtual ="/../../Includes/MenuLib.js"-->

If I add a new Virtual Directory and point it to the
includes pathe it still can't find the file but if I make
a new folder outside of the web structure and point to
that with a virtual directory the page can be found.??


No. Include virtual must be a descendant of the root, so in the web
structure, I think.

Perhaps this will do:

<% Server.execute Server.mappath( "/../../lib/myJs.asp") %>

[The whole idea was to have a .asp file
so that you can head that with a <% Response.Expire s = 0 %> ?]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #7
Mike D wrote on 06 aug 2004 in microsoft.publi c.inetserver.as p.general:
<!--#include virtual ="/../../Includes/MenuLib.js"-->

If I add a new Virtual Directory and point it to the
includes pathe it still can't find the file but if I make
a new folder outside of the web structure and point to
that with a virtual directory the page can be found.??


No. Include virtual must be a descendant of the root, so in the web
structure, I think.

Perhaps this will do:

<% Server.execute Server.mappath( "/../../lib/myJs.asp") %>

[The whole idea was to have a .asp file
so that you can head that with a <% Response.Expire s = 0 %> ?]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 19 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
4735
by: joethis | last post by:
Is there a way to make sure that a file is already in use using asp? For instance, if one person has opened a file and is about to write to it; then is there a way to keep another user from reading, or writing to that text file until the first user is finished?
4
3916
by: Jerry Khoo | last post by:
i am currently working on an assignment that requires the program to manage the files like editing file content, modifying file content, and deleting file contents. My question is what sort of header files i need to open a files, and what sort of function i can used to input/output a file content, another thing is that what sort of functions are they for me to know the location of the files pointer?
7
12960
by: A_StClaire_ | last post by:
hi, I'm working on a project spanning five .cpp files. each file was used to define a class. the first has my Main and an #include for each of the other files. problem is my third file needs to access the class defined in my second file and I can't figure out how to work this right. if I use an #include in my third file, my Main gives me a compile-time class redefinition error. if I don't, the third file can't "see" the second
5
1157
by: VB Programmer | last post by:
I want to write to a simple text file. If it doesn't exist I want to create it first. Here is my code (portion): Imports System.IO ' at the top of the class : : Dim strFileName As String = "C:\MyFile.txt" ' create file if not exist If Not File.Exists(strfilename) Then File.CreateText(strFileName)
0
1028
by: Roshan | last post by:
Hi, I am writing an app which needs to access & edit files on a remote share using the UNC path. I can access and edit the file using a simple StreamReader/Writer as long as the share has full access for everyone. But if I need to authenticate to the server containing the file, then how do I go about doing it? Is there a better way of acheiving the same? Without authenticating I get an UnauthorizedAccessException as
12
2821
by: Thomas Bartkus | last post by:
Does anyone use emacs together with both WordStar key bindings and python mode? I'm afraid that Wordstar editing key commands are burned R/O into my knuckles! I would like to play with emacs for Python editing but I'm having (2) problems. 1) When I load a .py file, emacs automatically overrides my wordstar-mode with python-mode, forcing all the keybindings back to emacs native keys. Why?
8
2064
by: D | last post by:
Hi, I currently have a Python app with a Tkinter GUI frontend that I use for system administration. Everytime it launches, it reads a text file which contains info about each host I wish to monitor - each field (such as IP, hostname, etc.) is delimited by !!. Now, I want to be able to edit host information from within the GUI - what would be the best way to go about this? Basically I just need to either edit the original host line, or...
0
880
by: ltfcphil | last post by:
Hi, Bit of a noobie question I'm afraid.... I have a program to open a file,read out part of each record to a text box, make a selection then extract the entire record. This works OK. Now I require to edit and replace the record. (Each field in the file uses commas as delimiters.) Attempting to replace a record either appends the file or overwrites the whole lot, so that I get a file with just my edited record in it. Can anyone...
16
2069
by: Lawrence Krubner | last post by:
To guard against our users possibly uploading huge files, I've got this in my php.ini file: ; Maximum size of POST data that PHP will accept. post_max_size = 10M On a server running Ubuntu Linux. The PHP version: root@ldc310:/etc/php5/cli# php -v
1
3329
by: crazyGal | last post by:
Hi there, I'm working on a task that deals with editing a PCL (Printer Command Language) file. The requirement is search/replace a key/value pair if found in the file. When I try this, either the file gets corrupted or the wrong data gets edited. It works fine if I try for single key/value. The more I try to edit, it gets messed up. I've been trying to find the page limiter for such PCL files since my scope is limited to editing first...
0
8361
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8278
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8466
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8584
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7299
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6158
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4144
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1912
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1588
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.