asp-classic

VBScript ISO8601

一世执手 提交于 2019-12-05 09:14:31
In VBScript, does FormatDateTime have ISO 8601 support? If not, how would I write such function with it? For example: Response.Write FormatAsISO8601(#05/04/2011#) Function FormatAsISO8601(datetime) ... End Function Alon Gubkin Here is the specific code I needed from Chris' class, a bit more optimized: Public Function ToIsoDateTime(datetime) ToIsoDateTime = ToIsoDate(datetime) & "T" & ToIsoTime(datetime) & CurrentTimezone End Function Public Function ToIsoDate(datetime) ToIsoDate = CStr(Year(datetime)) & "-" & StrN2(Month(datetime)) & "-" & StrN2(Day(datetime)) End Function Public Function

Mapping classic asp pages to .net in IIS

吃可爱长大的小学妹 提交于 2019-12-05 09:02:36
I'm trying to map requests for classic asp pages to be handled by .net, so that it runs through a custom httpmodule. In IIS I have remapped asp requests to aspnet_isapi.dll - I'm sure I've done this bit right Now in my test app I am getting this error: Server Error in '/TestASPRedirect' Application. -------------------------------------------------------------------------------- This type of page is not served. Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.asp' may be incorrect. Please review the URL below and make sure

What to put in a session variable

大憨熊 提交于 2019-12-05 07:47:21
I recently came across a ASP 1.1 web application that put a whole heap of stuff in the session variable - including all the DB data objects and even the DB connection object. It ends up being huge. When the web session times out (four hours after the user has finished using the application) sometimes their database transactions get rolled back. I'm assuming this is because the DB connection is not being closed properly when IIS kills the session. Anyway, my question is what should be in the session variable? Clearly some things need to be in there. The user selects which plan they want to edit

How do I get root url using ASP not ASP.net

两盒软妹~` 提交于 2019-12-05 07:35:41
How do I get root url using ASP not ASP.net? I have found this question ( How do I get the site root URL? ) but it is related to ASP.net. ===================================== Abbas's answer provide me the parent site root url but does not provide me the subsite root url ===================================== Classic ASP had a Request.ServerVariables collection that contained all server and environment details. Here's what the classic ASP version of the example .NET code looks like: function getSiteRootUrl() dim siteRootUrl, protocol, hostname, port if Request.ServerVariables("HTTPS") = "off"

classic asp/asp.net website - global.asa not working

有些话、适合烂在心里 提交于 2019-12-05 07:12:11
I've recently been given a website written in classic asp to configure and set up - although it also appears to have pages written in asp.net. The problem I'm having at the moment is that it doesn;t appear to be picking up settings from the global.asa file such as Application("ConnectionString").... As when I try to write them out from somewhere in the code - nothing appears. Any idea how to congure this website to use global.asa...or why it's not already using it? There is web.config file and global.asax...shouldn't this just be for .net? The code will not compile in visual studio. I've seen

How to tell whether a variable in ASP has been declared

此生再无相见时 提交于 2019-12-05 06:54:34
Let me start off by saying I'm a PHP developer, not an ASP one. (And I really wish ASP had isset() .) And I'm working in a live environment so I don't really have an opportunity to do any testing. All the resources I've found suggest different ways to test for the existence of a variable. Here's what I'm trying to do: On SOME pages, I set a variable which holds a value for a robots <meta> tag: dim dsep_robots dsep_robots = "nofollow,noindex" All pages include header.asp . In my header file, I want to test whether dsep_robots has a value and if so, output that value, otherwise, output nothing.

ASP - Printing the entire request contents

笑着哭i 提交于 2019-12-05 05:40:05
I'm debugging some ASP code and I need to get a quick printout of the current Request datastructure, which I believe is an array of key/value pairs. I see that Request.Form("key") is the method for extracting individual elements. Any tips on printing out the entire thing? Try this For Each item In Request.Form Response.Write "Key: " & item & " - Value: " & Request.Form(item) & "<BR />" Next Try a FOR/EACH loop: for each x in Request.Form Response.Write(x) Next Working: For x = 1 to Request.Form.Count Response.Write x & ": " _ & Request.Form.Key(x) & "=" & Request.Form.Item(x) & "<BR>" Next I

Is there an OR/M for Classic ASP?

牧云@^-^@ 提交于 2019-12-05 05:20:52
Is there an OR/M (object relational mapper) that can be used in Classic ASP? Even a simplified class object would be a great help in handling simple CRUD tasks. Yes I know ASP.NET has many and I use a few of them for ASP.NET sites. However this is a legacy e-commerce site that uses ASP/VBScript and a total rewrite it not a possibility. You could use .net through COM Interop, and do your ORM in .net. Another option would be to use Code Smith , or MyGeneration and generate VB6 classes. Here's some VB6 ORM I have not used or researched any of these: http://www.sparxsystems.com.au/products/ea

How do you get the name of the current virtual directory using ASP Classic?

你说的曾经没有我的故事 提交于 2019-12-05 04:48:54
问题 How do you get the name of the current virtual directory using ASP Classic? In ASP.NET you can use Request.ApplicationPath to find this. For example, let's say you have a URL like this: http://localhost/virtual_directory/subdirectory/file.asp In ASP.NET, Request.ApplicationPath would return /virtual_directory 回答1: You can get the virtual path to the file from one of several server variables - try either: Request.ServerVariables("PATH_INFO") Request.ServerVariables("SCRIPT_NAME") (but not

Session in classic ASP

混江龙づ霸主 提交于 2019-12-05 04:48:48
I'w working on a project in classic ASP and I want to add, for example, some users for a temporary list and when I submit the form, this data will be save to DB. I know how to work with this in asp.net, but not in classic asp. Is it possible to create lists of users, for example, and manage this in a session? thanks! yesa, you can use this, or the application state. one thing do note, you cant save objects in it, so you'll need to do some serialization if you want to store any complex things in it. Session("username")="Donald Duck" Session("age")=50 http://www.w3schools.com/ASP/asp_sessions