I've been searching for some information on the use of Classes in ASP, but found very little information. I found this http://www.daniweb.com/tutorials/tutorial19997.html . Are there more information somewhere online?
For the majority of my work, I just use plain ASP. On the rare occasion that I am doing something intensive that does require user interaction I might create a COM component (ie where performance gain outweighs the overhead of COM).
A simple Rule-of-Thumb. I imagine this is fairly common practice... (I hope it is, at least).
However, I'm curious about VBScript Classes. I would have imagined that if a page was complex enough to merit defining and creating your own classes/objects, that COM would be appropriate...
In which case, when and how do people use VBScript Classes?
I am re-coding a VB application to be used on the web, some of which requires additional DB components for user registration etc. Usually I use ASP classes to manage the DB I/O stuff but I was wondering whether they are any benefits in having them as VB classes and compiled as dlls?
I like the idea of having the VB application as dlls, but using asp classes for the general functionality of the application. However, I don't wish to do this out of convience for myself.
one developer once told me that he doesn't use classes as there is a performance issue. is this true? the functions i'd be creating can easily go into an include file as a set of functions and not a class. so i'm not too sure about going ahead and encapsulating them into classes. has anyone got any input?
I've been working in .NET for some time now and I don't remember specifically how asp classes are cleaned up in classic asp. I've been put on a Classic ASP project(ugh) and we're having some serious stability problems. Once we reach a point of sustained CPU useage of over 80% IIS 6 restarts the w3wp.exe process which of course terminates all sessions and resets the website.
I've noticed that the previous developer has an include which creates a couple of class objects in ASP. Not third party or "CreateObject" objects, but ASP classes. This include is in A LOT of files and the classes not being destroyed in any of them.
My question is could this be the problem? I seem to remember a problem with ASP classes and not destroying them causing leaks of some sort. I need to mention that the memory doesn't seem to be leaking but the CPU utilization goes wacko as if ASP/IIS is corrupt. My environment is Windows 2k3 and IIS 6. The previous environment was Windows 2K and IIS5. Both environments had the problem.
Before I go through these hundreds of files I was wondering if anyone remember what the problem was with ASP classes not being destroyed.
I've always had problems getting my head around using collections and classes together. Separately, they seem like fairly simple subjects, but I'm getting muddled up when trying to use them together.
Can someone toss together a simple example of how I'd create my classes and collection? Code:
I'd like to create a class file for a shopping cart that I'm working on but I'm not sure about how to use the database with it.
Do I connect and open to the database inside the class or outside of the class and set the properties?
I'm thinking that if I open and close the database with say a getItem() method and I have 15 items to get, I'll be opening and closing a connection 15 times. Isn't that bad?
I write classes in php, beans in jsp, what "modularity" does asp have? Can I write classes? Or "com" what can I do? which advantages exist with these paths: classes, com, etc.
<% Dim objMainItem Set objMainItem = New ItemContent objMainItem.item_id = 1 objMainItem.Open() %
and the class ItemContent creates a recordset based on the item_id passed in. Each item record contains the fields (header,label,content). I would like to reference the fields in the following format
Is there a way to use classes written in .NET in an ASP classic application? Maybe similair to using DLLs with Server.CreateObject? I want to write all our new classes using .NET with the intent of eventually changing the web application to ASP.NET.
I've tried Googling for the answer but I only get ASP.NET literature. Any suggestions for that problem?
I'm currently new to OO programming with Classic ASP and have been stopped dead in my tracks on the issue of validation inside classes and if I should be doing things that way. I have been using a User class and it has methods such as Save(), Update() and Delete(). Particularly with the Update() method I'm unsure if I should be validating my form(s) within the class or on the actual edit.asp page that uses the Update() method?
I have two types of edit pages; one for Admin users and one for the My Account page. On the My Account page if the user wants to change their password they have to enter their current password, a new password and then their new password again to confirm .
If an Admin user is updating that same user's info they do not have to go through those steps and they can simple just change the password by typing it in. The point here is that there are two separate cases of validation rules on two separate pages that both use the Update() method. Do you validate your forms inside your classes or outside?
I've written two classes in ASP (vbscript). Basically I am attempting a form of data encapsulation. The classes are a "master" class and an "address" class. The address class basically wraps a recordset. I've attached the file. whenever I call the "move" method the recordset should be EOF since there is only 1 record in my streetaddress table. If I write out the value of of p_oRs.eof inside of the "move" method it returns true.
I have declared p_oRs as a public variable. But if I access it from a different method (or a property get/let) then the p_oRs recordset is no longer EOF the pointer is on the first and only record.
Say I have a few functions for accessing a database e.g. openDBConn, closeDBConn, openRs, closeRs, getRsAsArray, executeSql, getDbConnString etc
I could put these functions in to an include file "incDbHelper.asp" and include the file in any page that needs database functionality... or I could create a class "clsDbhelper.asp" which again I would include in any page that needs it. Now once the files have been included, to access the functions I could do: Code:
I've read that one shouldn't include ADO objects in the Global.asa for the sake of performance, but would user-defined classes cause the same kind of performance hit? Assuming that they wouldn't, is it possible to do it?
I can't seem to figure out how to include them, nor find any reference to it in msdn.
Is there a way to do this? Or should I create a slew of Session variables? Code:
Is there any way that I can store my ASP code in an Access DB and have it display that way? Ideally, I would like to make a page with a text area that I can write and edit code in, and then when I submit it, I would like to view the page that the code creates. The code in the DB would include code that selects from and updates the DB. I would like to do this because I can't work remotely now.
This is the error. Microsoft OLE DB Provider for ODBC Drivers (0x80040E14) [Microsoft][ODBC Microsoft Access Driver] Syntax error (missing operator) in query expression 'CLASSDATE >= 6/23/2004 ORDERBY CLASSDATE'.
This is the code.
Code:
strSQL = "Select * FROM WellClass WHERE CLASSDATE >= " & DATE & " ORDERBY CLASSDATE"
I am trying to follow the W3Schools tutorial on the XMLDOM object, and it works fine in a regular HTML document inside <script> tags (vbscript), but I am trying to do it in the ASP tags (<% %>) and it does not work. The error says:
Code:
Microsoft VBScript runtime (0x800A01A8) Object required: '[object]'
I am trying to do something with it and I can figure out what to do!I have created a database that lets realtors track clients, potential clients, and offers made. Here is a link to the database:(URL address blocked: See forum rules) What I am trying to do is create a form that lets a user enter his first name, last name, email, and offer amount into textboxes. When they click send it adds their information to the Potential Buyer table (the primary key is an auto generated number.) The offer table is basically an associative table, containing the following information: buyer$buyerid, client$clientid, and amount. I would like the amount to be added to this table, and I would like it to also add the newly created buyerid. My problem is that well, I have no idea how to do this, as the buyerid is created only seconds before I need to post it in the offer table. Could anyone help me out with this? I'd really appreciate it.
Here's the current code that I'm using for navigation through some pages. MY question is, I want the item "System-Add Ons" to still stay bolded if I'm on a page that's in a subset of "Products" Is this possible?
For example, if a user gets to the page "Monitors," (monitors.asp) I want System-Add Ons to stay bolded....
How can I set up subsets of the "Products" page? Do I have to make a directory and do a test if the page is in the directory "Products" and is affiliated with "Products?" Code:
I Wanna to know that which of below codes related to ADO within ASP (VBscript) is better?
CODE ONE :: rsEduCalender.CursorLocation=3 With rsEduCalender if .State=1 then .Close .Open SQLstr,cn,3,1 End With '''''''''''''''''''''''''''''''''''''''''''''''''' ''''''''''''''''''''''' CODE TWO:: With rsEduCalender if .State=1 then .Close .CursorLocation=3 .Open SQLstr,cn,3,1 End With
i created ASP page for Online TEST it Consist three pages First Page is Selection of Topic and Number of Questions from List Box. Second page is shows the Questions as per the Selection in previous page Datas from the Database. Third Page is Result Page. But My problem is in Second Page, because all the question are created dynamicaly so that how can i get the User answer I get the question id and correct answer for all the questions. but i need to get the user answer for Result.I attached my code for the second page.
Is there a program or website that will validate my asp pages?Kind of like how html pages can be validated on http://www2.imagiware.com/RxHTML/ and on http://netmechanic.com
this is what i am doing for zip codes i want user to enter zip codes like this
92274 92274-0965
so if the user enters zip code like this 92274 then its right but if he enters zip codes like this 922740965 then change it to 92274-0965 this is what i have done so far so i have got the values of first 5 i need to include a -and then the rest of the numbers any idea how to make this work