asp-classic

If condition not working in classic ASP

一笑奈何 提交于 2019-12-23 16:05:09
问题 I am new to classic ASP. What is wrong with the code below: If condition error, don't get it. Please help. <select NAME="Priority" style="WIDTH:200px" Id="Priority"> <option value='0' <%= if(condition) then "selected" end%> 0 </option> <option value='1' <%= if(condition) then "selected" end%> 1 </option> <option value='2' <%= if(condition) then "selected" end%> 2 </option> <option value='3' <%= if(condition) then "selected" end%> 3 </option> </select> 回答1: Should be : <% if condition then

ASP Classic coding on the Mac?

社会主义新天地 提交于 2019-12-23 16:01:26
问题 Anyone here do classic ASP development on the Mac? The biggest thing that I'm looking for is a Web Preview that is capable of handling ASP Include files. I personally use Textmate and Espresso for web development, but neither of those handle Include files. My boss is in love with Dreamweaver but I'm loathe to adopt it because I've never liked using it. If it's my only way to go then I'll have to but I was hoping someone knew of another environment that would work for me. 回答1: Coda is a decent

Send HTML email asp

霸气de小男生 提交于 2019-12-23 15:44:06
问题 I want to add some html in an email. I've tried the following. vFromName = "someone" vFromAddress = "someemail" vTo = "recipient" vSubject="someSubject" vBodyofemail = "<html><table><tr><td><b>SomeText</b></td></tr></table></html>" Call SendMail() sub SendMail() 'change to address of your own SMTP server strHost = "mail.internal.rouses.com" Set Mail = Server.CreateObject("Persits.MailSender") 'enter valid SMTP host Mail.Host = strHost 'From eMail address Mail.FromName = vFromName 'From

Connecting to a named instance of SQL Server 2008 from classic ASP

蹲街弑〆低调 提交于 2019-12-23 15:41:06
问题 My ASP application connects to the network server where SQL Server 2000 is installed with no problem. The old code that works: myConn.Open ("Driver={SQL Server}; Server=myNetwrkServer; Database=myDB; UID=myID;PWD=myPWD;Trusted_Connection=NO;") An instance of SQL server 2008 was installed on the same network server. The new code doesn't work: myConn.Open ("Driver={SQL Server Native Client 10.0}; Server=myNetwrkServer\SQLServ2008; Database=myDB; UID=myID;PWD=myPWD;Trusted_Connection="NO";)

How to merge two XML files in classic ASP?

混江龙づ霸主 提交于 2019-12-23 15:18:19
问题 I'm using classic ASP in my project. I want to merge two XMLs together. How do I do this? Below is my sample code: XML 1 <CATALOG> <CD> <TITLE>1</TITLE> <ARTIST>Bob Dylan</ARTIST> <COUNTRY>USA</COUNTRY> <COMPANY>Columbia</COMPANY> <PRICE>10.90</PRICE> <YEAR>1985</YEAR> </CD> <CD> <TITLE>2</TITLE> <ARTIST>Bonnie Tyler</ARTIST> <COUNTRY>UK</COUNTRY> <COMPANY>CBS Records</COMPANY> <PRICE>9.90</PRICE> <YEAR>1988</YEAR> </CD> <CD> <TITLE>3</TITLE> <ARTIST>Dolly Parton</ARTIST> <COUNTRY>USA<

Return an image using ASP, not .NET

a 夏天 提交于 2019-12-23 13:14:13
问题 Using traditional ASP how can I return an image from a query. I want to use an image on a web page for tracking purposes, so for example I might have a page containing: <img src="../cgi-bin/getimage.asp?user1234&page=1232" WIDTH="1" HEIGHT="1"> Where GetImage.ASP would record the passed details and return a transparent GIF. 回答1: Use response.binarywrite to give an image as an output in your getimage.asp. If you store the image as a BLOB in database, or if you read the image from a file, get

vbscript round to 2 decimal places using Ccur

纵饮孤独 提交于 2019-12-23 12:37:59
问题 I am using CCur() instead of CDbl() as answered in this question: vbscript mathematical expression not working But I want to display amount to decimal places e.g 3 should be 3.00 and 3.555 should be 3.55. How can I achieve this using CCur() function? 回答1: CCur() is a "Convert to Currency" function, not a number formatting function. Use following functions instead: FormatNumber (number [,DecimalPlaces [,IncludeLeadingZero [,UseParenthesis [, GroupDigits]]]] ) or FormatCurrency (Expression[

Using a dictionary object in application scope in Classic ASP

邮差的信 提交于 2019-12-23 12:28:57
问题 Following up from my last question does anyone know how I can use a dictionary object in application scope in Classic ASP? You cannot use Scripting.Dictionary - if you try you will see something similar to the following: Application object error 'ASP 0197 : 80004005' Disallowed object use /xxx.asp, line 2. Cannot add object with apartment model behavior to the application intrinsic object. I found this article on (good ol') 4GuysFromRolla but it points to Microsoft's free Lookup Component and

List Keys in JScript object using VBScript (Classic ASP)

断了今生、忘了曾经 提交于 2019-12-23 12:12:31
问题 I am using the JSON2 script in an asp page to parse JSON post data. After parsing the data, I have an object in VBScript that allows for notations such as: jsonData.key I wish to parse through all the keys, however, I have no knowledge of the key names. How would I go about doing this? Example JSON: { "dbtable":"TABLE1", "dbcommand": "INSERT", "dbfilter": "ID" } Thanks 回答1: You need to enumerate the property names of the object however this is a very alien thing to do in VBScript. You will

InvalidCharacterError in IE only

◇◆丶佛笑我妖孽 提交于 2019-12-23 09:26:41
问题 We have an order form that uses a ziplookup feature for when a zipcode is entered into a field, the city, county, state and zip are then entered into the same field. <tr> <td class="formLabel" id="<%=prefix%>.ZipCodeLookup.label">Zip Code</td> <td class="formColon">: </td> <td class="formData"> <div id="zipOutput"></div> <input type="hidden" id="<%=prefix%>.city" name="<%=prefix%>.city" value="<%=City%>" /> <input type="hidden" id="<%=prefix%>.county" name="<%=prefix%>.county" value="<%