ASP

81K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.

Share tech news, updates, or what's on your mind.

Sign up to Post

I am trying to utilize this piece of classic asp code and am getting errors:
<a href='javascript:delay(Update.asp?c=" & request.QueryString("c") & "&g=" & request.QueryString("g") & "')>

Open in new window

I only get errors when request.QueryString("g") contains a space:

Invalid left-hand side in assignment

Below is the function:
<script>
	function delay (URL) {
	setTimeout( function() { window.location = URL }, 500 );
	}
</script>

Open in new window


Thoughts?
0
OWASP Proactive Controls
LVL 12
OWASP Proactive Controls

Learn the most important control and control categories that every architect and developer should include in their projects.

I'd like to remove quotation marks from the "username" field before it is submitted.
Can this be done with JavaScript ?
0
I have a simple stored procedure which generates insert statements, and I want to know how to execute them automatically.

I am calling this stored procedure from a button on a Classic ASP page., which is the reason for wanting the INSERT statements to be executed after they are created.

In its simplest form,  here is the statement that generates the INSERT statements :

SELECT 'INSERT INTO DEV_Test (''' + txtSchoolID + ''', '''', '''', '''', '''' )' FROM DEV_Test2

Open in new window


… and this is what is produced :

INSERT INTO DEV_Test ('150721346050', '', '', '', '' )
INSERT INTO DEV_Test ('3456407213', '', '', '', '' )
INSERT INTO DEV_Test ('3721313250', '', '', '', '' )
INSERT INTO DEV_Test ('3721388839', '', '', '', '' )

Open in new window


… and I want the stored procedure to execute these statements.

Can anyone help?

Thank you

Jim
0
I installed parallels in a MacOS and then installed Windows 10.
We run a simple ClassicASP Application on the local IIS for development purposes.  It uses a few third party plugins.

We have the exact same configuration on another computer and it works just fine there, but on this install of Windows 10 when we try to use any of the plugins I get the following error:

Microsoft VBScript runtime error '800a01ad'

ActiveX component can't create object: 

Open in new window

0
I am trying to work with Thread.CurrentPrincipal and need some help with that. Never used that before so any help will be helpful.

this is what i have so far.

            interface IAmSomething
            {
                  bool something(string role);
            }

public async Task<IActionResult> Index()

{
var haveRole= Thread.CurrentPrincipal as IAmSomething;

if (haveRole.something("some_string_value"))
{
}

I just need to test for now by hardcoding some values so what should i do in order for the if statement to work. as expected if statement is throwing a null exception .
0
Hi all, I am lost to how to make this work... or to describe it

the code:
<%
Set PackageOption=oConn.Execute("SELECT * FROM enq_items WHERE land_ID=1251 AND item_type=35")
%>
<td width=10% align=center rowspan=2><input type=hidden name=itemID value=5280><select name=packageID>
<%
Do Until PackageOption.EOF
%>
<option><%=PackageOption("item_ID")%></option>
<%
PackageOption.MoveNext
Loop
%>
</select><br><input type=submit name=package value='Add'></td>
<%

Open in new window

Submit Code:
oConn.Execute("UPDATE enq_items SET item_package="&Request.Form("packageID")&" WHERE item_ID="&Request.Form("itemID"))

Open in new window

error:
UPDATE enq_items SET item_package=5434, 5434, 5434, 5434, 5434, 5434, 5434, 5434 WHERE item_ID=5280, 5279, 5281, 5283, 5282, 5284, 5289, 5285
Microsoft JET Database Engine error '80040e14'

Syntax error in UPDATE statement.

/process.asp, line 955

Open in new window


As you can see its grabbing multiple packageIDs & itemIDs, how do i get it to grab just 1 of each?
0
This is not really a problem - yet. It is merely me trying to understand how to secure my code from sql injection. I'm using classic asp as it's all I know.

As far as I understand using stored procedures within my mysql database and then  calling these procedures would be the way forward. I'd like to get this working.
I was directed towards this web-page in an earlier question: https://www.mikesdotnetting.com/article/5/saved-parameter-queries-with-ms-access-and-asp

However this concerns an MS access database, and I can't get it to work in my mysql database (for obvious reasons I guess).

Let's assume that I have table MyTable with the followong fields: Id (mediumint), GUID (varchar), Name (Text), DateInserted (Datetime), Comments (Text) (DateTime), Status (mediumint)

I need to read from, update, insert and delete in this table.
I would need to create stored procedures for this, right? I can't seem to find a way to do that using phpMydAdmin (which is what I got and will use, regardless). How would I create these procedures?

Remember that this has to work with classic asp.
Best regards
Michael
0
I'm using asp.net web forms and visual basic.

On my page i have a ASP Textbox.

I'm using the TextChanged event.

This is my code:

    Protected Sub TextBox1_TextChanged(ByVal sender As Object, ByVal e As EventArgs)


        HiddenField_TextBox1Changed.Value = TextBox1.Text

    End Sub

So when I type some text in the textbox, the textchanged event is saving the value I typed in the textbox, to a hidden field.

What's the equivalent to the TextChanged event of a textbox using JavaScript instead of Visual Basic?
1
Hi everyone!

At my wits end here. I have this code:
<%
Dim UserIPAddress
UserIPAddress = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If UserIPAddress = "" Then
  UserIPAddress = Request.ServerVariables("REMOTE_ADDR")
End If



  userNow = Session("Bruger")
  
  SQLStr = "SELECT * FROM USERDATABASE WHERE Bruger = '" &  userNow & "'"
  Set RSDatabase = DATABASE.Execute(SQLStr)
  UserId =  RSDatabase("UserId")
  Admin =  RSDatabase("Navn")

GUID = Request.querystring("GUID")


   '*** Find brugernavn & adgangskode
    SQLmaal = _
     " SELECT "				&_
	"  *     "			&_
	" FROM   "			&_
	"  DATABASE "			&_
"  WHERE "			&_
"  GUID = " & GUID & "  "	

   Set RSDatabase = DATABASE.Execute(SQLmaal)

   GUID = RSDatabase("GUID")
id = RSDatabase("Id")
   navn = RSDatabase("Navn")
   Lokale = RSDatabase("Lokale")
   Email = RSDatabase("Email")
   tlf = RSDatabase("tlf")
   udstyr = RSDatabase("Udstyr")
   filepath = RSDatabase("filepath")
   Beskrivelse = RSDatabase("Beskrivelse")
   Datomodtaget = RSDatabase("Datomodtaget")
   Datoafsluttet = RSDatabase("Datoafsluttet")
   Bemaerkninger = RSDatabase("bemaerkninger")
   Sagsnr = RSDatabase("Sagsnr")
   Lokation = RSDatabase("Lokation")    



      

If DateM <> "" Then
a = Year( DateM ) 

b = Month( DateM )
if CInt( b ) < 10 then b = "0" & b

c = Day( DateM )
if CInt( c ) < 10 then c = "0" & c

j = Hour( DateM )
if CInt( j ) < 10 then j = "0" & j

e = Minute( DateM )
if CInt( e ) < 10 then e = "0" & e

f = second( DateM )

Open in new window

0
Experts,
               Greetings!

This question is for SQL SERVER 2012 used in windows server 2012 in a classic asp application.  This is in a functionality where we build the whole HTML required in a page in the stored procedure and write it in a classic asp page using response.write. Data in one column in a row exceeds 50k characters at least.  It was working fine until we used SQL SERVER as the driver and declared as varchar(max). But now that we want to use TLS 1.2, we have had to use SQL SERVER NATIVE CLIENT 11.0. Now it allows only 8000 when SQL SERVER NATIVE CLIENT 11.0 is used. We should be able to use a size of char(100000) for our application requirements. Please assist us with your expertise.


Thanks,
Isaac
0
Become a Certified Penetration Testing Engineer
LVL 12
Become a Certified Penetration Testing Engineer

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

Hello Experts,
                         We are attempting to disable TLS 1.0 and 1.1 in our servers. When we did that, our classic asp application did not work and we found that it is using SQL SERVER driver with SQLSRV32.DLL. It threw SSL Security error.
 
This is the actual connection string we use for Classic asp:
DRIVER={SQL Server};SERVER=XXXXXXXX;DATABASE=XXXXXXX;uid=XXXXXX; pwd=XXXXXXX
 
We changed the driver to the SQL SERVER NATIVE CLIENT 11.0. and it solved the problem. Everything else worked except for one page, the monthly calendar page. In the page, we generate the whole HTML for the page data in the database base table and append it directly on the .asp page using response.write.  The page does not throw any error, it simply does not load the data that we get from Database using a Stored Procedure.
 
When this did not work we used AJAX to get the html data. Even this did not work.
 
We tried saving HTML data in a variable which also did not happen.
 

We tried adding Response.ContentType = "text/html"
https://msdn.microsoft.com/en-us/library/ms524327(v=vs.90).aspx
 
we installed Microsoft® OLE DB Driver 18 for SQL Server with SQL Server Native Client 11 mentioned as Provider in the connection string. we got other errors.
 
 Is there any restriction with TLS older versions when we get the HTML directly and append it in a page?
 
 
0
I saw this example but this is using JavaScript

ASP TextBox JavaScript OnKeyup Event
https://forums.asp.net/t/1656156.aspx?onkeyup+in+asp+textbox

I want to use C# or VB

On a ASP.NET Web Forms page.

I have a TextBox that looks like this:

<asp:TextBox ID="TextBox1" runat="server" ></asp:TextBox>


When I click in the textbox with my mouse how do I save the text "you clicked in the textbox" to a ASP Hidden Field using C# or VB?
1
I'm using ASP.NET Web Forms and VB

On my page I have a ASP TextBox and a ASP Button

I'm using the TextChanged event for the textbox.

This is my working code for my page

ASP_TextBox_TextChanged4.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="ASP_TextBox_TextChanged4.aspx.vb" Inherits="ASP_TextBox_TextChanged4" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table>
            <tr>
                <td></td>
                <td><asp:TextBox ID="TextBox1" runat="server" ontextchanged="TextBox1_TextChanged" Text="This is a test"> </asp:TextBox></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></td>
            </tr>
            <tr>
                <td></td>
                <td><asp:Button ID="Button1" runat="server" Text="Button" /></td>
            </tr>
        </table>
    </div>
        <asp:HiddenField ID="HiddenField1" runat="server" />
    </form>
</body>
</html>

Open in new window


ASP_TextBox_TextChanged4.aspx.vb

Partial Class ASP_TextBox_TextChanged4
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    'TextBox.TextChanged Event
    ' Occurs when the content of the text box changes between posts to the server.
    

Open in new window

0
add function to classic asp page with vb script.
Is it possible to save a file temporarily and then attach it to an email in vbscript ?

If I split the code below into two distinct pages, both functions work. I can create the Vcard file and it opens to the user.  Or I can create the email.
But I want to add the vcard file to the email.  Is this possible ?
<% 
if (cStr(Request("SubmitHere")) <> "") Then

	Dim DTSTART, DTEND, SUMMARY, LOCATION, EVENT_DESCRIPTION, PRIORITY, UID, CalendarEvent
	
	DTSTART = DateAdd("h",+5, (rsSaleCallDataNewID.Fields.Item("FollowupDate").Value))
	DTEND = DateAdd("h",+5, (rsSaleCallDataNewID.Fields.Item("FollowupDate").Value))
		
	DTSTART = 	Right("0000" & Year(DTSTART), 4) & _
				Right("00" & Month(DTSTART), 2) & _
				Right("00" & Day(DTSTART), 2) & _
				"T13000" & _
				"Z"
	
	DTEND = 	Right("0000" & Year(DTEND), 4) & _
				Right("00" & Month(DTEND), 2) & _
				Right("00" & Day(DTEND), 2) & _
				"T130000" & _
				"Z"
 
	SUMMARY = (rsSaleCallDataNewID.Fields.Item("VisitType").Value)
	LOCATION = (rsSaleCallDataNewID.Fields.Item("Company").Value)
	EVENT_DESCRIPTION = (rsSaleCallDataNewID.Fields.Item("Comments").Value)
	PRIORITY = "0"
	UID = (rsSaleCallDataNewID.Fields.Item("ID").Value)
	
	CalendarEvent = "BEGIN:VCALENDAR" & vbCrlf & _
	"VERSION:1.0" & vbCrlf & _
	"BEGIN:VEVENT" & vbCrlf & _
	"DTSTART:" & DTSTART  & vbCrlf & _
	"DTEND:" & DTEND  & vbCrlf & _
	"SUMMARY;ENCODING=QUOTED-PRINTABLE:" & SUMMARY & vbCrlf & _
	

Open in new window

0
I'm having trouble using double quotes in vbscript within asp web page.  I get various errors but I'm sure it's my syntax on the quote marks:

objCDO.AttachFile "ContactManagementActivityEditVCal.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "varVcal=yes&" & "var_SaleCall_ID=" &  rsSaleCallDataNewID.Fields.Item("ID").Value %>"
0
hi want to decode QRCode
from file
using asp.net ...
please help
0
Don get recaptcha

i have this form running good

  <form  method="post" action="contact.asp"> 
                       
                        <b>Envíenos un mensaje</b> <span></span>
                        <input  type="text" name="fname" id="fname" required placeholder="Nombre">
                       <input type="email"  name="email" id="email" required placeholder="Dirección de Email">
                      <input type="text" name="telefono" id="telefono" required placeholder="Teléfono">
                      <select name="Consultorio" type="text" id="consultorio">
                        <option>Elija Consultorio...</option>
                        <option>Querétaro</option>
                        <option>San Miguel</option>
                    </select>
                    <!--<textarea name="message" id="message" placeholder="Escriba aquí su mensaje..." rows="10" cols="30"> </textarea>-->
                    <textarea name="message" id="message" rows="4" cols="50" required placeholder="Escriba aquí su mensaje..."></textarea>
                    <input type="submit" name="send" id="send"  value="Enviar Mensaje">
                    </form>

Open in new window


then i need to insert this

  <button class="g-recaptcha"
                                data-sitekey="6Lccr3wUAAAAAsdssasacLfhRgG1N9q49kVmVYZpOeQ"
                                data-callback="YourOnSubmitFn" type="submit" name="send"  id="send"  value="Enviar Mensaje">
                           Enviar Mensaje
                        </button>

Open in new window


where to insert?
My form do not work if i put button tag, its working  whit   <input type="submit"

Please you experts!
1
Hello

Firstly, I am not particularly familiar with asp, so I dont really know how to ask the question to get the result I want, so please forgive me if what I write is not clear or obvious.

I am trying to update a classic ASP website (which the client will not allow me to change for anything else more secure...).  

I need to show a list of manufacturer logos from our database where the manufacturer makes a certain type of product, defined in the query string url.  There are tens of thousands of manufacturers in the db, some make multiple different type of products.  I only want to show one instance of each logo.

The db contains the columns "Manufacturer" and "Type"

The query string url example would be "abc.com/index.asp?pl=type" where type would be replaced with the type of product we want shown on the page, lawnmower, learjet, cellphone etc

I have a page which does a similar thing, in that it displays a single logo for all manufacturers it finds in the database:

<%@ Language=VBScript%>
<% Response.Expires = -1 %>
<%
	pro_type= lcase(request.querystring("pl"))
%>

<table width="100%">
	<tr>
		<td width="100%">
			<table width="100%" border="0">

				<%
                    Set adoCon = Server.CreateObject("ADODB.connection")' initialize connection
                    Set ors = Server.CreateObject("ADODB.RecordSet")' initialize record set
                    Const COLUMN_COUNT = 1
                    strSQL = "SELECT Distinct Manufacturer FROM 

Open in new window

1
Hi there, I have been trying to build an auto sum script, however all examples I have seen, either make no sense or I make a mess of it (dont know where to put)

Is anyone able to help me build one from scratch?

The Site:
http://dev.gptouring.com.au/home.asp?c=35&p=1&d=80

The autosum is of the products from each category, radio buttons with the autosum at the bottom of the page.

If you need some code, please let me know

Cheers in advance
0
OWASP: Forgery and Phishing
LVL 12
OWASP: Forgery and Phishing

Learn the techniques to avoid forgery and phishing attacks and the types of attacks an application or network may face.

Hi all, I am having some issues with expand/collapse and wondering if anyone can help

The issue I am having is it is auto expanded, where I want it collapsed

You can see here: http://dev.gptouring.com.au/home.asp?c=35&p=1&d=80

VBScript
function Expand(node)
	{
	if (node.children.length > 0)
		{
		if (node.children.item(0).tagName == "IMG")
			{
			node.children.item(0).src = "http://www.gptouring.com.au/images/GPT/s-collapse.png";
			}
		}
	node.nextSibling.style.display = '';
	}

function Collapse(node)
	{
	if (node.children.length > 0)
		{
		if (node.children.item(0).tagName == "IMG")
			{
			node.children.item(0).src = "http://www.gptouring.com.au/images/GPT/s-expand.png";
			}
		}
	node.nextSibling.style.display = 'none';
	}

function Toggle(node)
	{
	if (node.nextSibling.style.display == 'none')
		// Unfold the branch if it isn't visible
		{
		Expand(node);
		}
	else
		// Collapse the branch if it IS visible
		{
		Collapse(node);
		}
	}

Open in new window

Code:
<td height=15 colspan=4><a onClick='Toggle(this)' id='CorporateStaff' style='CURSOR: hand'><img src=http://www.gptouring.com.au/images/GPT/s-collapse.png height=15 valign=middle>&nbsp;<font size=2>Expand to upgrade your <%=PackageItemHeroType("itype_name")%></font></a>
<div>
<table width=100% cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=40><%=ItemOptionDisplayName%></td>
<td height=40 width=72 align=center valign=center>
<table width=72 height=36 cellpadding=0 cellspacing=0 border=0>
<tr>
<td height=36 background=<%=BrandDir%>/item-<%=PackageItemOption("prod_items.item_ID")%>.jpg style='background-size:cover;background-position: center,center'><a href=images/GPT/image.jpg><img src=<%=BrandDir%>/s-i-outline-zoom.png width=72 height=36></a></td>
</tr>
</table>
</td>
<td height=40 width=50 align=center><input type=radio name=<%=PackageItemOption("pitem_ID")%> value=<%=PackageItemOption("pitem_gross")/PackageItemOption("pitem_pax")%>></td>
<td height=40 width=150></td>
</tr>
</table>

Open in new window

0
Hello All;

I have a table where the column is a varchar.
(If it needs to change to an INT or Date, please let me know and I will do so.
It is not too late to make that change.)
In the column named = Years
It has the following example.

1978
1965
1985
2017
1962
1998
2012
2002
1958
1978

OK, What I need to do is the following.
For the years in the table, they need to output as

1950
1960
1970
1980
1990
2000
2010
etc...

Thanks.
Wayne
0
Hello, All;

For SQL Server 2016.
I used to have this code lying around somewhere, but I am unable to find it.
OK.

table (SomeNames)
Johnny
Carr
Wayne
Ronda
Valerie
Tanya
Joey
Vin
Ron
Tony

OK, in the above, I would like to have a list of the Alphabets
Since there is NOT the whole list of letters to comprise the entire Alphabet, it would only show the letters for the names that are available.
For the example above, would be.


C
J
R
T
V
W

Once there are more names added which contain the other letters in the alphabet, then it will then display them letters.
And what I am going to do, is have each letter as a hyperlink on the page, to display all the names for that letter.

Hope this is clear.
I wish I knew where the code was at that I once have.
It is probably buried in a project script, of which I do not remember the name I gave it.
As it was about 5+ years ago, that I remember using it last, as it was at my old home.

Thanks all;
Wayne
0
Hi Experts,
On my classic ASP page I'm displaying a record like this:
<%=rs("UserID")%>

UserID always has to be 6 characters, e.g. 123456
When it's less than 6 characters I would like to display zeroes in front of it, e.g. when UserID is 23456 I would like to display it as 023456
Thank you for your help
0
Can someone help me identify what is wrong with my JQuery/Bootstrap?  On my main page (https://www.gopherstateevents.com/) the top dropdown works well...designed to work on mouse over.  This is a page created in Mobirise.  I tried to re-create the rest of my pages (using classic ASP) but the nav bar has to be clicked to function.  Here is an example:  https://www.gopherstateevents.com/results/cc_rslts/cc_rslts.asp?sport=cc

Obviously something is either mis-placed or missing altogether.  Any help would be much appreciated!
0
I need to be able to separate child nodes and apply logic

my XML Source: https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/ZPBUA1ZLXKLA00941?format=xml

For some reason the text values are concatenating but I want them to be broken out by the Node name and value.  I put notes in the code.  The Code DOES work just not how I need it.

  
<%

url = "https://vpic.nhtsa.dot.gov/api/vehicles/decodevin/ZPBUA1ZLXKLA00941?format=xml"
     
     ' add a BASE HREF tag
     Dim xmldoc
     dim xmlhttp 
      
     Response.write "<BASE HREF='" & url & "'><P>" & url  & "<P>"
    
     
     set xmlhttp = CreateObject("Microsoft.XMLHTTP")
     Set xmlDoc = CreateObject("Microsoft.XMLDOM") 
     xmlhttp.open "GET", url, false 
     xmlhttp.send ""
          'response.write xmlhttp.responsetext
          
          xmlDoc.async = False
          bresult=xmlDoc.loadxml(xmlhttp.responsetext)
       
       State = ""
        ' WORKS ...Set NodeList = xmlDoc.getElementsByTagName("*")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/*")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/*")
   Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/DecodedVariable")
        'Set NodeList = xmlDoc.documentElement.selectNodes("/Response/Results/DecodedVariable/*")






        For Each Node in NodeList




         'I NEED SOME SORT OF LOGIC HERE
	           If Node.tagName = "VariableId" Then		        
		        ' 

Open in new window

0

ASP

81K

Solutions

31K

Contributors

Active Server Pages (ASP) is Microsoft’s first server-side engine for dynamic web pages. ASP’s support of the Component Object Model (COM) enables it to access and use compiled libraries such as DLLs. It has been superseded by ASP.NET, but will be supported by Internet Information Services (IIS) through at least 2022.