asp-classic

How to map a classic asp request to an mvc controller and action

五迷三道 提交于 2019-12-08 08:45:36
问题 To say that routing is not my strong suite is an understatement, so please bear with me. I have this link in one of my pages and I need my MVC route to pick this up and map it to the "MyArea" area "MessagesController" controller "Inbox" method http://localhost/MyArea/messages/list.asp?pjid=&box=in&sf=mesibox What I've come up with so far does not cut it. routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.IgnoreRoute("favicon.ico"); routes.MapRoute( "Messages", "messages/list.asp", new {

Populate Dropdown from SQL in Classic ASP

微笑、不失礼 提交于 2019-12-08 08:39:20
问题 I am trying to force users to only select certain values when adding a record. So naturally I am using a dropdown, but I'd like the options to be populated by a specific field in the database. I figured I'd do a Do/Loop but I am apparently doing something wrong. Dim dstrSQL Dim drs dstrSQL = "SELECT EventID FROM Events" set conn2 = CreateObject("ADODB.Connection") conn2.open CONN_STRING set drs = conn2.execute(dstrSQL) conn2.close: set conn2 = nothing Do Response.Write "<option value=" & drs

ADODB.Connection error '800a0e7a'

☆樱花仙子☆ 提交于 2019-12-08 07:52:25
问题 Anyone know what does that error mean? I have just copied my ASP classic website files to my Windows 7 x64 machine. And I have installed IIS 7.0. I am trying to access the website and it gives me that error. 回答1: Take a look at this thread. There's no 64-bit Jet driver. You will need to enable 32-bit applications: 来源: https://stackoverflow.com/questions/3590546/adodb-connection-error-800a0e7a

Is it possible to use named parameters when command type is adCmdText?

放肆的年华 提交于 2019-12-08 07:41:12
问题 I'm trying to use named parameters with following query through Adodb.Command but no luck. Select * From mytable Where col1 = Lower(@param1) And col2 = Upper(@param2) And col3 = @param1 The code I used something like that. Dim cmd Set cmd = Server.CreateObject("Adodb.Command") cmd.NamedParameters = True cmd.CommandType = adCmdText cmd.CommandText = "Select * From mytable Where col1 = Lower(@param1) And col2 = Upper(@param2) And col3 = @param1" cmd.Parameters.Append cmd.CreateParameter("

How to convert VB script array to JavaScript array classic asp

旧城冷巷雨未停 提交于 2019-12-08 07:31:20
问题 Classic asp: sub a aryaa(0,0)=1 aryaa(0,1)=2 end how to call this array in script function, and how to make this vbscript array to javascript array. Please help me out from this, since 3 days i m searching for this. Thanks. 回答1: Suppose MY VBScript array is aryATTPlans than the below code describe ( VBScript array to Javascript array) // this is client JS code var aryATTPlans = new Array(); var aryATTPlans = new Array(2); var i, j; <% ' this is server VBS code If IsArray(aryATTPlans) Then j=0

Response.ContentType = “application/vnd.ms-excel” works in IE and firefox but not in Safari

假装没事ソ 提交于 2019-12-08 07:16:57
问题 I have got an asp file with the following header Response.ContentType = "application/vnd.ms-excel" ,it displays the file in an excel format.This works in IE and firefox but not in safari. Any ideas why? 回答1: Well, you can try forcing it like so: Content-type: application/force-download Content-disposition: attachment; filename="somefile.txt" Please say if it works for you. Hope it helps. 来源: https://stackoverflow.com/questions/4959732/response-contenttype-application-vnd-ms-excel-works-in-ie

Visual Studio, TFS, MVC and Classic ASP Project Setup

五迷三道 提交于 2019-12-08 06:09:30
问题 There are a number of questions existing but I am just trying to clarify best practice on this. I have Classic ASP site that we wish to migrate to MVC3. I am trying to decide the best project structure for setting this all up in a new Visual Studio 2010, TFS environment. I want to start a new Solution in Visual Studio and get the structure correct. I want it done right as I have about 30 projects to migrate. In most projects I have a few hundred ASP, HTML, JavaScript, CSS files etc. and an

Export to Excel using ASP

与世无争的帅哥 提交于 2019-12-08 04:59:07
问题 At the time of exporting to excel using ASP. After converting a column in text format single quote is visible in the excel file. how to hide this automatically ? 回答1: You might be helped by setting the style of your cell to mso-number-format:"\@", but I'd have to see your code to know the exact problem. I think you might find Styling Excel cells with mso-number-format and Generate Excel files in ASP Classic useful. 回答2: When you export to excel, you could juste make a table with cell, and put

Can I create Date entry control with date separator for classic ASP

做~自己de王妃 提交于 2019-12-08 04:19:26
I was using a calendar control for entry of date in a classic-ASP application. But calendar control is not keyboard friendly and take more time for data entry. So later I added a simple text box with date validation. It works fine. However, the user need to put the date separator also. I wish to put a date entry field that comes with a pre-configured date format and separator, so that the user simply type on the numbers and the field cause a validation as well. How can I achieve this? Dee Just use jQuery/javascript to mask the date text field. It will automatically format the date as the user

Classic ASP session to MVC session

佐手、 提交于 2019-12-08 04:17:55
问题 Is it possible to set a session in Classic ASP and use it in an MVC project? I have taken over a project for a company and they have original website in MVC and they the new feature I am adding needs to be in MVC, I am not able to convert the classic ASP to MVC because it would require to much time. So I am looking for a solution where I can set a session in ASP and use it in MVC. Currently I am setting a session by passing in an ID through a URL to the first MVC page they visit. Which looks