asp-classic

vbscript: getref with parameter

走远了吗. 提交于 2019-12-10 09:26:08
问题 has anyone experience with passing a parameter to a function called with getref ? Following code is just an example, doens't work, how to pass the parameter to the mySub sub? <button id="myBtn">Click me</button> <script type="text/vbscript"> document.getElementById("myBtn").onclick=GetRef("mySub") Sub mySub(parameter) alert(parameter) End Sub </script> 回答1: First look at this article about event handling (anybody knows a better reference?) to get the context for: The code provided in the

ASP Session variables: Is “” same as IsEmpty?

我的梦境 提交于 2019-12-10 09:23:21
问题 In ASP an uninitialized Session variable Is Empty. I know that the correct way to check for a Session value, and remove a value, is the following: IF NOT IsEmpty(Session("myVar")) THEN ' Go ahead and use Session("myVar") ... ' Now if we're all done with myVar then remove it: Session.Contents.Remove("myVar") END IF I've inherited a codebase where Application and Session variables are typically set = "" after use, and all tests for a value are of the form (Sessions("myVar") = "") . This test

How to tell whether a variable in ASP has been declared

余生颓废 提交于 2019-12-10 04:22:28
问题 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

One jQuery Change Event on Multiple Elements

家住魔仙堡 提交于 2019-12-10 01:52:03
问题 I have 3 textboxes, all with the same id's that I process into ASP by bringing it into a controller array I have a link that adds an unlimited number of textboxes below the first 3. My current change statement: $('input.#invent').change(function () { works fine for the change event on the first textbox, but the others with the same information do not fire it when changed What is the best strategy for getting the change event to fire when any of the 3+ textboxes change?? 回答1: Change all three

ASP Line-breaks - \n?

允我心安 提交于 2019-12-10 01:25:21
问题 I have been searching for a way to insert linebreaks in my code for when I view my source. I am not looking for <br /> Something like the PHP equiv to \n Any ideas on how to do this in ASP? I will be placing this inside a string. 回答1: There's no way to do it inside a string. You will have to append vbCrLf like so: Response.Write "hello" & vbCrLf & "world" If you want to include it in the string, you could do a replace after like so: output = "hello\nworld" output = Replace(output, "\n",

step through debugging for classic asp with VS2008

喜夏-厌秋 提交于 2019-12-09 23:48:12
问题 I am coming from the django world to maintain a fairly complicated classic asp site. Unfortunately the site is riddled with uncommented, copy/pasted, spaghetti code spread out over several hundred files hidden away in a few dozen directories. To be curt, it's a bit of a nightmare ;) Anyway, I am most familiar with eclipse, and I was wondering if Visual Studio 2008 can do the kind of debugging capabilities you would expect from such a prolific IDE. Can I step through this asp application line

Handling hashed passwords stored as varbinary in SQL Server and classic ASP

…衆ロ難τιáo~ 提交于 2019-12-09 21:57:47
问题 All, Sorry in advance - I'm a novice in most of the topics below (SQL, ASP). Anyway... I've got a pretty simple web app that requires users to log in with a user name and password. The front end creates a salted SHA1 hash of the password, and posts it (along with the user's name) to an ASP page. That ASP page takes the data, calls a stored procedure in the SQL Server database, and passes the users name and hashed password; the stored procedure writes the info to the 'users' table. The

Random exclamation mark in email body using CDO

此生再无相见时 提交于 2019-12-09 19:04:49
问题 We are getting random exclamation (!) mark in email body using CDO object in Classic ASP. We are not getting this exclamation mark with outlook. Problem only occur with Lotus Notes client. We use IIS SMTP server to send email. Edit Set myMail= Server.CreateObject("CDO.Message") myMail.Subject="Business and Company News on your Mobile Device" myMail.From="no-reply@test.com" myMail.To="some@email.com" htmlbody = htmlbody (coming runtime) myMail.BodyPart.ContentTransferEncoding = "quoted

Why adParamOutput parameter doesn't contain a value after execute

放肆的年华 提交于 2019-12-09 18:36:03
问题 I am using ASP classic with ADO, connecting to SQL Server 2008. I inherited this code and it is so mangled that I will try to recreate the relevant parts. If you need more detail or I left something out, please let me know. I create a command and add parameters oCmd.CommandType = adCmdStoredProc ... oCmd.Parameters.Append oCmd.CreateParameter("@MyOutputParam", adInteger, adParamOutput, 4, NULL) Later, I open a reader from that command: oRS.Open oCmd, , adOpenForwardOnly, adLockReadOnly After

How can I write binary data to disk in VBScript?

我的未来我决定 提交于 2019-12-09 18:35:51
问题 I have a binary string that I need to write to a file. I have a feeling that this should be a simple procedure, but then again, VBScript. The FileSystemObject is of no help, since it munges the data. The Stream object looks promising, with it's adBinaryMode and its Write method, but the Write method requires a byte array and won't seem to accept a variant array instead. Since VBScript arrays are all variant arrays, this seems problematic. So, how do I just write the data to a file? EDIT: I