I've been using ASP to create my database-driven websites for about 2 years now and I'm getting a little sick of always having the scripting code mixed in with how the page should look.
All I can imagine doing to solve the problem is to pre-build any content(with minimal html formatting) early on in the script and then output those strings in the desired spots on the html section.
I've also been told that I should use XSLT to separate code and content, but I'm a little hazy as to how the model works. The way I understand it, I change all my ASP to output ONLY XML and then I set up the server to run XSLT on the those XML pages based on style sheets that I design. Is this correct?
If so, what are the best programs to use to support this 'ideal' code and content separated form of development on the ASP platform?
scenario: a user submits a form, create session variables in login.asp and redirect to main.asp
session in login.asp example: session("uid") = var
experiment: i tried opening two browsers, and entered two different userid(uid), i also put response.write(session("uid")) within main.asp to check if different users are displayed.
problem: the session var from the second browser overwrites the session var of the first browser. so if the first browser "adds" something to a database, it gets the session var of the second browser, and not the first one.
question: how can i maintain the session var from the first browser? separating each session var from each browser.
the last part text=I need to split into 2 parts I need to read the first part 19 and match that to the db and then deal with the name David,I have tried everything, is there anyway of doing this even if the string read text=19+david if there was a way of separating the two.
I have an asp page which lists records. Each record has an ID appended to it.
On the following edit page, I am trying to test against a certain field value, if it is >0 then run the update, otherwise don't. The problem is the data for testing is as follows:
Dim arrMetal Dim iLoop arrMetal=split(request.form("ID"), ", ")
For iLoop=0 to Ubound(arrMetal)
IF request.form("del_qty_" & arrMetal(iLoop)) 0 THEN
Where del_qty is a number entered in the form, and arrMetal(iLoop) is the records ID whilst in the loop on the edit page. When I try the above if statement I get an error: 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
I have two tables, raceresultsview and jockeyselections. In jockeyselections, I have jockey names and stableid, for example Pat Day, stableid 1000.In raceresultsview, I have jockey names, and placement. I want to do something like this: select * from raceresultsview where jockey in (select jockey from jockeyselections). This works FINE, but I need to figure out how to grab the stableid, too.Each time there is a match, I want to insert the stableid and placement into the table named winnings.
Heres my for next loop. Basically it is pulling files from a folder. Now I want it so that if it reaches the end of all of the files, that it starts over at the beginning. Any ideas? Code:
Moderator (from admin) will see a list of cities to approve/decline.
If approved, then the city will show up in the search and alert city list boxes.
If declined, then the moderator will be asked to pick an approved alternate city and all postings containing the user-inputted city name will be changed to the alternate approved city name.
The moderator will be notified via email when not listed is selected.
Any one have any ideas on how to build this in ASP? I'm kinda new to this ASP programming thing.
I'm looking for a script that will auto complete the state field when someone enters their zipcode.
I'm currently using http://javascript.internet.com/forms/zip-to-state.html but its kind of out dated and often returns null. Does anyone know of a more up-to-date version or one that is updated regularly? It doesn't have to be free.
This was originally posted to Macromedia forum but maybe someone here can assist....... I am a total Newbie to ASP and forums....trying to begin dynamic site building....purchased almost all Sitepoint books trying to determine if ASP, PHP or which is best/easier......
Simple ASP file failing.......also SMTP e-mail from form
Using Training from the source book - Dreamweaver MX dynamic sites.......but software is actually Studio MX 2004, running on Windows 2000 platform using local Microsoft IIS as testing server.... Code:
I learned basic ASP at a computer trade school where it involved sql. After buying webspace from a host, I later learn they do not support sql, only ms access. I've been using code that deals with sql, but at the same time my database has been done in access.
my host has on several occasions been called to fix server side problems, but now it seems only my code is at fault. it tells me the exact line with the problem, but i can find nothing wrong with it, mind you im not very experienced. im hoping that perhaps you will be able to set me straight with this problem. below is the line of code that is erroneous.
From where I can get free ASP script like ASPIN.com or Hotscripts.com uses to show product and programs with there ratings and searching options. I need same script as ASPIN.com or Hotscripts.com use to desplay product information.
I've just been reviewing a COM component (VB6) that I wrote a while ago to record when and where 404 errors occur; each error is logged in a DB along with supporting information.
Looking at it now, I'm wondering why I chose a COM component rather than just an ASP page. There is not that much code involved, so I could easily have expanded the ASP page that calls the DLL to do the whole job....
COM Component: Generally perform faster than an ASP page, but there is an overhead associated with creating a new object in the calling ASP page, so more suited to more intense apps that dont require user-interaction. Also keeps code private of course.
ASP: Keeping you code in an ASP page is often more efficient for smaller jobs, where the cost of creating a COM object outweighs the potential performance gain. Also prefered for tasks that require frequent user interaction. Code remains public (to those who have access to server).
This is what prompted my question: At what point, does it become worthwhile to go for a COM component as opposed to an ASP page? Is there that much difference in it?
Are perceptions of the issues fairly accurate?
I've updated the DLL in question - it was a bit of a ball ache: modify code & compile, reset IIS, then copy DLL to server and re-register. I know my DLL in this example doesnt do much, and I'm certain that modifying and copying ASP pages would be simple & efficient, but at what point does it pay to use a DLL?
I want the ASP code to pull data from the database. If i enter one of the field in the form and then click on Search button, the data for the other fields should automatically pop up.