Jump to content

Search the Community

Showing results for tags 'ASP'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL








  1. Hi everyone, On a new project, i would like to prevent users from entering a date earlier than the first day of the month preceding the current month. To be more precise, today (dd/mm/yy -> 19/11/19) i would like to prevent entering a date earlier than 01/10/19 (dd/mm/yy format). When using following code. It works. <!DOCTYPE html> <html> <body> <p>Click the button to display first day of preceding current month.</p> <button onclick="myFunction()">Try it</button> <p id="demo"></p> <script> function myFunction() { var dateMin = new Date(); dateMin.setFullYear(dateMin.getFullYear(), dateMin.getMonth() - 1, 1); document.getElementById("demo").innerHTML = dateMin; } </script> </body> </html> When i click on Try it button, on 19th november 2019, i've got Tue Oct 01 2019 (+ time) displayed. But when using following code in my .js file : var dateMin = new Date(); dateMin.setFullYear(dateMin.getFullYear(), dateMin.getMonth() - 1, 1); $(function () { $("input[InputTypeCheck='DateSaisieMin']").datepicker({ onSelect: function () { }, dateFormat: 'dd/mm/yy', minDate: dateMin, changeYear: true, changeMonth: true }, $.datepicker.regional['fr']).attr('readonly', 'readonly'); }); and following code in my .aspx file : <p> <label class="LblLibelle">Date</label> &nbsp;&nbsp; <asp:TextBox ID="txt_dateDeclaration" runat="server" InputTypeCheck="DateSaisieMin" AutoPostBack="true"></asp:TextBox> <asp:RequiredFieldValidator ID="rfv_dateDeclaration" runat="server" ControlToValidate="txt_dateDeclaration" Display="Dynamic" ErrorMessage="La date de l'absence est obligatoire" ValidationGroup="ajout"> <label class="zoneObligatoire">&nbsp;*</label> </asp:RequiredFieldValidator> </p> I was expecting to be unable to select a date in the datepicker prior to 01/10/2019, but this is not the case. The datepicker shows every month since August. Can someone tell me where I made a mistake ? Many Thanks to all.
  2. smus

    Hex to ASCII

    Couldn't find the information how on how to convert the hex values into ascii ('31' > '1', '32' > '2' etc.). Could anyone remind me which method/function I should use?
  3. I am using this classic ASP script (VBScript) to show all the files and folders in a directory: The script is originally from here: https://support.microsoft.com/en-us/help/224364/creating-a-directory-browsing-page-using-asp <%@LANGUAGE="VBSCRIPT"%> <% Option Explicit On Error Resume Next ' this section is optional - it just denies anonymous access If Request.ServerVariables("LOGON_USER")="" Then Response.Status = "401 Access Denied" End If ' declare variables Dim objFSO, objFolder Dim objCollection, objItem Dim strPhysicalPath, strTitle, strServerName Dim strPath, strTemp Dim strName, strFile, strExt, strAttr Dim intSizeB, intSizeK, intAttr, dtmDate ' declare constants Const vbReadOnly = 1 Const vbHidden = 2 Const vbSystem = 4 Const vbVolume = 8 Const vbDirectory = 16 Const vbArchive = 32 Const vbAlias = 64 Const vbCompressed = 128 ' don't cache the page Response.AddHeader "Pragma", "No-Cache" Response.CacheControl = "Private" ' get the current folder URL path strTemp = Mid(Request.ServerVariables("URL"),2) strPath = "" Do While Instr(strTemp,"/") strPath = strPath & Left(strTemp,Instr(strTemp,"/")) strTemp = Mid(strTemp,Instr(strTemp,"/")+1) Loop strPath = "/" & strPath ' build the page title strServerName = UCase(Request.ServerVariables("SERVER_NAME")) strTitle = "Contents of the " & strPath & " folder" ' create the file system objects strPhysicalPath = Server.MapPath(strPath) Set objFSO = Server.CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder(strPhysicalPath) %> <html> <head> <title><%=strServerName%> - <%=strTitle%></title> <meta name="GENERATOR" content="The Mighty Hand of Bob"> <style> BODY { BACKGROUND: #cccccc; COLOR: #000000; FONT-FAMILY: Arial; FONT-SIZE: 10pt; } TABLE { BACKGROUND: #000000; COLOR: #ffffff; } TH { BACKGROUND: #0000ff; COLOR: #ffffff; } TD { BACKGROUND: #ffffff; COLOR: #000000; } TT { FONT-FAMILY: Courier; FONT-SIZE: 11pt; } </style> </head> <body> <h1 align="center"><%=strServerName%><br><%=strTitle%></h1> <h4 align="center">Please choose a file/folder to view.</h4> <div align="center"><center> <table width="100%" border="0" cellspacing="1" cellpadding="2"> <tr> <th align="left">Name</th> <th align="left">Bytes</th> <th align="left">KB</th> <th align="left">Attributes</th> <th align="left">Ext</th> <th align="left">Type</th> <th align="left">Date</th> <th align="left">Time</th> </tr> <% '''''''''''''''''''''''''''''''''''''''' ' output the folder list '''''''''''''''''''''''''''''''''''''''' Set objCollection = objFolder.SubFolders For Each objItem in objCollection strName = objItem.Name strAttr = MakeAttr(objItem.Attributes) dtmDate = CDate(objItem.DateLastModified) %> <tr> <td align="left"><b><a href="<%=strName%>"><%=strName%></a></b></td> <td align="right">N/A</td> <td align="right">N/A</td> <td align="left"><tt><%=strAttr%></tt></td> <td align="left"><b><DIR></b></td> <td align="left"><b>Directory</b></td> <td align="left"><%=FormatDateTime(dtmDate,vbShortDate)%></td> <td align="left"><%=FormatDateTime(dtmDate,vbLongTime)%></td> </tr> <% Next %> <% '''''''''''''''''''''''''''''''''''''''' ' output the file list '''''''''''''''''''''''''''''''''''''''' Set objCollection = objFolder.Files For Each objItem in objCollection strName = objItem.Name strFile = Server.HTMLEncode(Lcase(strName)) intSizeB = objItem.Size intSizeK = Int((intSizeB/1024) + .5) If intSizeK = 0 Then intSizeK = 1 strAttr = MakeAttr(objItem.Attributes) strName = Ucase(objItem.ShortName) If Instr(strName,".") Then strExt = Right(strName,Len(strName)-Instr(strName,".")) Else strExt = "" dtmDate = CDate(objItem.DateLastModified) %> <tr> <td align="left"><a href="<%=strFile%>"><%=strFile%></a></td> <td align="right"><%=FormatNumber(intSizeB,0)%></td> <td align="right"><%=intSizeK%>K</td> <td align="left"><tt><%=strAttr%></tt></td> <td align="left"><%=strExt%></td> <td align="left"><%=objItem.Type%></td> <td align="left"><%=FormatDateTime(dtmDate,vbShortDate)%></td> <td align="left"><%=FormatDateTime(dtmDate,vbLongTime)%></td> </tr> <% Next %> </table> </center></div> </body> </html> <% Set objFSO = Nothing Set objFolder = Nothing ' this adds the IIf() function to VBScript Function IIf(i,j,k) If i Then IIf = j Else IIf = k End Function ' this function creates a string from the file atttributes Function MakeAttr(intAttr) MakeAttr = MakeAttr & IIf(intAttr And vbArchive,"A","-") MakeAttr = MakeAttr & IIf(intAttr And vbSystem,"S","-") MakeAttr = MakeAttr & IIf(intAttr And vbHidden,"H","-") MakeAttr = MakeAttr & IIf(intAttr And vbReadOnly,"R","-") End Function %> Now I need to exclude some files from viewing, for example, web.config file. I inserted this expression inside For Each loop, but it does not hide it and calls an error. if strName = 'web.config' Then Next
  4. I have been given a .asp file that needs converting into PHP, the only issue i am having is with the mass update fields. <%@ Language=VBScript %> <% if Request.QueryString("Home") = Request.QueryString("Away") Then %> <% Response.Redirect("same.asp") %> <%End If%> <% if Request.QueryString("HomeGoal") > Request.QueryString("AwayGoal") Then%> <% Home = Request.QueryString("Home") away = Request.QuerySTring("Away") Goal = Request.QueryString("HomeGoal") GoalIn = Request.QueryString("AwayGoal") Set objConn = Server.CreateObject("ADODB.Connection") ConnStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=databse;UID=username;PWD=password!;" objconn.Open(ConnStr) objConn.Execute "UPDATE teams SET Victories = Victories + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Points = Points + 3 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & Goal & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & GoalIn & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Defeats = Defeats + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & GoalIn & "' WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & Goal & "' WHERE Team='" & Away & "'" objConn.Close Set objConn= Nothing %> <%End if%> <% if Request.QueryString("HomeGoal") < Request.QueryString("AwayGoal") Then%> <% Home = Request.QueryString("Home") Away = Request.QuerySTring("Away") Goal = Request.QueryString("HomeGoal") GoalIn = Request.QueryString("AwayGoal") Set objConn = Server.CreateObject("ADODB.Connection") ConnStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;DATABASE=databse;UID=username;PWD=password!;" objconn.Open(ConnStr) objConn.Execute "UPDATE teams SET Defeats = Defeats + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & Goal & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & GoalIn & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Victories = Victories + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Points = Points + 3 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & GoalIn & "' WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & Goal & "' WHERE Team='" & Away & "'" objConn.Close Set objConn= Nothing %> <%End if%> <% if Request.QueryString("HomeGoal") = Request.QueryString("AwayGoal") Then%> <% Home = Request.QueryString("Home") Away = Request.QueryString("Away") Goal = Request.QueryString("HomeGoal") GoalIn = Request.QueryString("AwayGoal") Set objConn = Server.CreateObject("ADODB.Connection") ConnStr = "DRIVER={MySQL ODBC 3.51 Driver};SERVER=localhost;databse=fifa2;UID=username;PWD=password!;" objconn.Open(ConnStr) objConn.Execute "UPDATE teams SET Draws = Draws + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Points = Points + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & Goal & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & GoalIn & "' WHERE Team='" & Home & "'" objConn.Execute "UPDATE teams SET Draws = Draws + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Points = Points + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Played = Played + 1 WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Made = Made + '" & GoalIn & "' WHERE Team='" & Away & "'" objConn.Execute "UPDATE teams SET Let = Let + '" & Goal & "' WHERE Team='" & Away & "'" objConn.Close Set objConn= Nothing %> <%End if%> <% Home = Request.QueryString("Home") %> <% Away = Request.QueryString("Away") %> <% HomeGoal = Request.QueryString("HomeGoal") %> <% AwayGoal = Request.QueryString("AwayGoal") %> <head> <title>Game: <%=Home%> against <%=Away%> - Result updated...</title> <H3>Result submitted</H3><HR> <CENTER><B><%=Home%> - <%=HomeGoal%> - <%=AwayGoal%> - <%=Away%></CENTER><BR> <HR> <% if HomeGoal = AwayGoal Then %> <CENTER>The game ended as a draw!</CENTER> <%End If%> <% if HomeGoal > AwayGoal Then %> <CENTER><%=Home%> won against <%=Away%> !</CENTER> <%End If%> <% if HomeGoal < AwayGoal Then %> <CENTER><%=Away%> won against <%=Home%> !</CENTER> <%End If%> </b> <input type="button" value="Back" OnClick="top.location='results.asp'"> result_process.asp
  5. I have tried to add a search bar to my own website that will send the user to another page in my project, the value in the search box will send the user to the page. Main.aspx: //The main page <form id=search1 method=get action=search.aspx> <input type=text name=search id=search placeholder="Search Here" /> <button type=submit name=search id=go>Search</button> </form> Search.aspx.cs: //The page that will deal with the search info string sea = Request["search"]; Response.Redirect(sea+(".aspx")); As an example, there is a page called "2016" and writing it in the text box followed by submitting the form will send the user to the page 2016.aspx but the address bar says: localhost:8525//2016,.aspx Why is there a comma there? Do i have to change something with my code?
  6. The root problem is an ASPX (ASP.NET) web page program, part of an important business program presently in development and connected to an sql server database (.mdf) file, is presently unable to do two procedures: rs=Server.CreateObject("ADODB.Recordset") and rs.Open (sql1,conn). Both operations return rs.State = False. The reason is not clearly understood. The system is Windows XP SP3. The only error observed in the MSSQL ERRORLOG is: The SQL Server Network Interface library could not register the Service Principal Name (SPN) for the SQL Server service. Error: 0x54b, state: 3. Failure to register an SPN may cause integrated authentication to fall back to NTLM instead of Kerberos. This is an informational message. Further action is only required if Kerberos authentication is required by authentication policies. When researched on Internet this first url was found: Reference(1): https://blogs.technet.microsoft.com/mdegre/2009/11/08/the-sql-network-interface-library-was-unable-to-register-spn/ Where it says: If you run SQL Server under the LocalSystem account, the SPN is automatically registered as SQL registering with the machine account that has the right to create an SPN default. So Kerberos interacts successfully with the server running SQL Server. The settings currently in use are SQLEXPRESS (2008R2) service, on Manual, with Local System startup account logon. This startup account is believed to have enough permissions to register the SPN, but that may be for an sql expert to decide. The SQL Server is started manually using the System Tray Icon, when needed. So upon further thought, the inadequate permission argument for causing the failed Recordset object creation does not seem to make complete sense. Since the Local System account being used for the sql server startup account should already have enough permission? On the other hand, the SQL ERRORLOG continues to say it could not register the SPN? (So Internet research was continued.) Then on Internet this second url was found: Reference(2): https://blogs.msdn.microsoft.com/dataaccesstechnologies/2010/01/06/how-to-grant-readserviceprincipalname-and-writeserviceprincipalname-rights-to-sql-server-service-start-up-account-without-using-adsdiedit-tool/ Comment: Ironically (considering the url article title) the decision was to use the ADSI Edit tool to assign greater permissions. Where it says: Instead of setting SPNs manually, you may want to give ReadServicePrincipalName and WriteServicePrincipalName rights to SQL Server service start-up account so that it can register and de-register SQL Server SPNs on its own whenever the SQL Server service is started and stopped. As the above articles describe, these rights can be granted from ADSIEDIT tool. Comment: The intended use of ADSI Edit tool seemed close to succeeding and might have succeeded but all attempts to connect ADSI Edit to the running SQL Server local instance have only been unsuccessful. ADSI Edit seems unable to see the running local sql server. Not enough was known about ADSI Edit to fix that. This is a standalone laptop without a domain and without a LAN. (But again there is the local sql server instance to connect to.) Then two SQL stored procedures sp_ActiveDirectory_SCP and sp_ActiveDirectory_Obj fail while attempting to register the SQL Server instance and the database (.mdf) file into the Active Directory database saying instead the system does not have Active Directory installed (but of course it does, at least partially). Then on Internet this third url was found: Reference(3): https://technet.microsoft.com/en-us/library/cc773354(v=ws.10).aspx Where it says: Adsiedit.msc automatically attempts to load the current domain to which the user is logged on. If the computer is installed in a workgroup or otherwise not logged on to a domain, the message "The specified domain does not exist" displays repeatedly. To resolve this issue, you may want to open an MMC, add the ADSI Edit snap-in, make connections as appropriate, and then save the console file. The ADSI Edit snap-in was succesfully added to MMC. But ADSI Edit still seems unable to make the connection in this situation. And the console file would not save. There are two command line tools (from win supp tools 2003) which can also set these R/W rights. One being setspn.exe and the other dsacls.exe. But they both also seem to read and store the permissions information in the Active Directory database (NTDS.dit) file. So Iwould not expect them to work either for similar reasons. It seems I am trying to get Active Directory working in a windows workgroup consisting of only one machine. Is that, by definition, impossible, since a workgroup needs to have a minimum of two machines? Reference(4): https://mssqlwiki.com/2013/12/09/sql-server-connectivity-kerberos-authentication-and-sql-server-spn-service-principal-name-for-sql-server/ The reference(4) does not change my situation because it still requires an Active Directory database which again requires a domain or workgroup (LAN) neither of which are present in my case. But reference(4) is still beneficial because it excels at providing such a detailed Active Directory configuration example. My last thought is that in the absence of a domain or workgroup (LAN), there are still present in my case the SQL Server instance and the localhost server (provided by MS Expression Development Server). So I came to wonder if it was possible for ADSI Edit to connect to those two servers somehow? (Attempts so far have been unsuccessful.) I cannot imagine how my situation is so unusual. Is mine the only machine running ms sql server in a standalone configuration? I would expect there to be (many) others. Thank you for your time. Please advise.
  7. Hello, If i run the following code in an ASP page it loads the file (stored on local server) and outputs the text as expected; <p id="demo"></p> <button type="button" onclick="loadDoc()">Load Feed</button> <script> function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo").innerHTML = this.responseText; } }; xhttp.open("GET", "XML_TEST.xml", true); xhttp.send(); } </script> I need to run this from a URL not a local file. The URL has the exact same data and if i run the URL in a browser i get the data displayed in XML in the browser but when i change my code to fetch the data from the URL nothing happens. <script> function loadDoc() { var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { document.getElementById("demo").innerHTML = this.responseText; } }; xhttp.open("GET", "https://test.httpapi.com/api/domains/available.xml?auth-userid=user&api-key=key&domain-name=domain&domain-name=domain2&tlds=com&tlds=co.uk", true); xhttp.send(); } </script> any ideas please how i can get this to work?
  8. When I read from my MS Access database(unicode), the Cyrillic characters are not being written correctly in browser(utf-8). How to encode the data by VBScript in real time or how to convert it manually in MS Access? This is what I've found on this topic, but it seems to be quite complicated: http://stackoverflow.com/questions/22054934/capture-and-insert-unicode-text-cyrillic-into-ms-access-database/22072399#22072399
  9. I'm practicing and trying to write a table varying the opening row tags: @foreach(blah in blahs) { if (condition){ @Html.Raw('<tr>'); } else { @Html.Raw('<tr class="shaded">'); } // More row stuff here </tr> } Is there a way to do this? My editor keeps complaining about a missing <tr> tag. Is it possible to add a class to a tag using razor? What's the common practice? BTW, this is an incredible web site!
  10. this is the contact form pagea html document <html><head><link rel = "stylesheet" Type="text/css" HREF = "style.css"><script language="vbscript">function check( )if len(document.form1.Name.value)=0 OR len(document.form1.City.value)=0 OR len(document.form1.comments.value)=0 then Msgbox("Please fll in all the fields because your opinion makes a lot of difference.") else form1.action="addrecord.asp" form1.submit ( ) end ifend function</script></head><body background="214j.gif" Alink = #000000 Vlink=#000000 Link = #000066><P id = "heading"> Contact Us<P> <P id="catch"> <span style=color:#F88017> Your wedding</span> <span style=color:#F88017> Your style.</span><span style=color:#E56717>Our expertise.</span></P><hr id="line" Align=Right Width=25%><hr id="line2" Align=Right Width=15%><h1 style="Font-Family:Chiller;Word-spacing:5;color:#FF0040">We are excited to speak to you! Fill in as many details to help us get to serve you better.<form Method="post" name="form1">Name : <input type = text maxlength=20 name="Name" size = 20><br><br>Fiance Name : <input type = text maxlength=20 name = "Fiance_name" size = 20><br><br><br>Function Date: <input type = Date/Time maxlength=20 name = "Funtion_Date" size = 20><br><br><br>Event: <select style="FONT-family:Lucida Sans name="Event"><option>------------</option><option>Engagement</option><option>Reception</option><option>Pre Wedding Party</option><option>Honeymoon</option><option>Other</option></select><br><br>E-Mail: <input type = memo maxlength=20 name = "E_mail" size = 20><br><br><br>Address: <input type = memo maxlength=20 name = "Add_1" size = 20><br><br>Address : <input type = memo maxlength=20 name = "Add_2" size = 20><br><br>City: <input type = text maxlength=20 name = "City" size = 20> <br><br> Pincode : <input type = Number maxlength=20 name = "Pincode" size = 20><br><br>Mobile Number:<input type = Number maxlength=20 name = "Mobile_no" size = 20><br><br><br>Comments:<textarea style="MARGIN-LEFT:100 ; Margin-Top-20" Wrap = "VIRTUAL" Rows=10 Cols=40 name="comments"></textarea><br><br><br>Would like to be contacted: <br> <INPUT TYPE=radio name="yes" value="yes"> Yes <input type =radio name="No" value="No"> No<p><P> <INPUT TYPE="BUTTON" VALUE="SUBMIT" onClick="check( )" ></h1> </form></body></html> this is the page it is is getting directed to which is addrecord.asp <%<script=runat server>Dim objConn, strConn, objRSset objConn = Server.CreateObject("ADODB.Connection")objConn.open"DSN=Data"set objRS=Server.CreateObject("ADODB.RecordSet")objRS.Open"Wedding_Planning_Website",objConn,2 ,2objRS.AddNewobjRS("Name")=Request.Form("Name")objRS("Fiance_name")=Request.Form("Fiance_name")objRS("Function_Date")=Request.Form("Function_Date")objRS("Event")=Request.Form ("Event")objRS("E_mail")=Request.Form("E_mail")objRS("Add_1")=Request.Form("Add_1")objRS("Add_2")=Request.Form("Add_2")objRS("City")=Request.Form("City")objRS("Pincode")=Request.Form("Pincode")objRS("Mobile_no")=Request.Form("Mobile_no")objRS("Comments")=Request.Form("Comments")objRS("Would_you_like_to_be_contacted")=Request.Form("Would_you_like_to_be_contacted")objRS.UpdateobjRS.CloseobjConn.CloseSet objRS=NothingSet objConn=Nothing this is the area where the record is being displayeddim objConn, strConn, objRSset objConn=Server.CreateObject("ADODB.Connection")strconn="DSN=Data"set objRs = Server.CreateObject("ADODB.RecordSet")objRS.Open "Wedding_Planning_Website", objConn%> </head><body Alink = "#000000" Vlink ="#000000" Link="3399CC"><P Id = "heading"> Wedding 'in' style<P><P id = "catch"><span style = color:#F88017> Your Wedding </span><span style = color :#F87217> Your style.</span><span style = color:#E56717> Our expertise.</span></p><hr id = "line" Align = Right Widtd = 25%><hr id = "line2" Align = Right Widtd = 15%><h2 style = "Font-Family:Orlando;Word-spacing:5; color:#000066">Views</h2><center><table Border=1 Cellspacing = 0 cellpadding =15 bordercolor = #CC6600><tr><TH><Font size = 5 face = "Calligrapher"> Name </TH><TH><Font size = 5 face = "Calligrapher"> Fiance_name </TH><TH><Font size = 5 face = "Calligrapher"> Function_Date </TH><TH><Font size = 5 face = "Calligrapher"> Event</TH><TH><Font size = 5 face = "Calligrapher"> E_mail </TH><TH><Font size = 5 face = "Calligrapher">Add_1 </TH><TH><Font size = 5 face = "Calligrapher">Add_2</TH><TH><Font size = 5 face = "Calligrapher"> City</TH><TH><Font size = 5 face = "Calligrapher"> Pincode</TH><TH><Font size = 5 face = "Calligrapher"> Mobile_no</TH><TH><Font size = 5 face = "Calligrapher"> Comments </TH><TH><Font size = 5 face = "Calligrapher">Would_ you_ like_ to_ be_ contacted </TH><% while not objRs.EOF %><tr><td> <Font size = 3 ><%objRs("Name")%> </td><td> <Font size = 3 ><%objRs("Fiance_name")%> </td><td> <Font size = 3 ><%objRs("Function_Date")%> </td><td> <Font size = 3 ><%objRs("Event")%> </td><td> <Font size = 3 ><%objRs("E_mail ")%> </td><td> <Font size = 3 ><%objRs("Add_1")%> </td><td> <Font size = 3 ><%objRs("Add_2")%> </td><td> <Font size = 3 ><%objRs(" City")%> </td><td> <Font size = 3 ><%objRs("Pincode")%> </td><td> <Font size = 3 ><%objRs("Mobile_no")%> </td><td> <Font size = 3 ><%objRs("Comments")%> </td><td> <Font size = 3 ><%objRs("Would_ you_ like_ to_ be_ contacted")%> </td></tr><%objRs.MoveNextWendobjRs.CloseobjConn.CloseSet objConn=NothingSet ObjRs = Nothing</table></script>%> I need urgent help as the program is not working pls help
  11. Dear All; Need your help. I am programming students' roll call in ASP with SQL 2008 R2. There are about 100 students. By default option selected is 'Present' using drop down list. I tried to use radio buttons but only one button remains selected so I am using drop-down list ( How to select multiple radio buttons?). After selecting "Present", "Absent","Late" etc, how do I insert all 100( or whatever number) of rows in the SQL table simultaneously? How should I use "for", "loop" or any other method? Please guide. Regards DAMODAR
  12. Can anyone please explain why the Int function returns random incorrect values in the following code? Running Win Server2003 and IIS 6. The full code and result can be viewed here www.patronomy.com/test/test-int.asp I couldn't believe it at first because Stripe (a payment processor) requires whole numbers eg, 803 for $8.03 and as you can see the iteration has many errors. <table><%TR "Value", "Int(Value*100)"For i = 1 to 10 For j = 1 to 10 k = i+(j/100) TR k, int(k*100) NextNext %></table><%Function TR(str1, str2) Response.Write("<tr><td>"&str1&"</td><td>"&str2&"</td></tr>")End Function%>
  13. Hello, I am using the html5 input type date field in an asp page. I have it saving to the database fine, but how do I display the date as a variable when bringing the date back in the same input type tag? I need to bring it back in the same input tag so the date could be updated if the web user needs to change the original date when adding. Thanks, Dave
  14. I have a form that features a drop down list that uses sqldatasource1 to automatically have the user selected. I'm wanting to add linkbuttons (A-Z) so when the user selects the given linkbutton only users who's last name begins with that letter is visible in the drop down list. I have stored procedure written and created sqldatasource2 for this but I'm unsure of how to code it to reflect what I'm wanting it to do.
  15. My goal is to have users fill out three fields and click on a button that will check an sql table to see if there is a record with those three fields already in the database. I'm not 100% sure, but I think my issue is in my C# code calling the procedure. I have tested my stored procedure from sql and it works. I've tried a few things, but nothing is working. The code below is one of my attempts that isn't working. I'm not sure, but when I step through the program it doesn't appear to be calling the procedure (though I could be wrong and the problem is elsewhere). SqlConnection conn = new SqlConnection(GetConnectionString()); try { conn.Open(); SqlCommand cmd = new SqlCommand("SubmitCheck", conn); SqlParameter sqlCheck = new SqlParameter("@result", DbType.Int16); cmd.Parameters.AddWithValue("@pfName", fName.Text); cmd.Parameters.AddWithValue("@plName", lName.Text); cmd.Parameters.AddWithValue("@pssn", ssn.Text); cmd.CommandType = CommandType.StoredProcedure; bool check = Convert.ToBoolean(cmd.ExecuteScalar()); if (check) { checkEntrylbl.Text = "You have not yet completed this form. Please complete the form."; checkEntrylbl.Visible = true; lName.Enabled = false; fName.Enabled = false; ssn.Enabled = false; submitButton.Enabled = true; } else { checkEntrylbl.Text = "You have completed this form. You do not have to fill it out again."; checkEntrylbl.Visible = true; } } catch (System.Data.SqlClient.SqlException ex) { string msg = "Insert Error:"; msg += ex.Message; throw new Exception(msg); } finally { conn.Close(); } Here is the stored procedure code. SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE PROCEDURE SubmitCheck -- Add the parameters for the stored procedure here @pfName varchar(50), @plName varchar(50), @pssn int AS BEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Checks if there is an entry with the same first name, last name, and last four of ssn. IF (EXISTS(SELECT fName, lName, ssn FROM dbo.compassSurvey WHERE @pfName = fName AND @plName = lName AND @pssn = ssn)) BEGIN RETURN (0); END BEGIN RETURN (1); END END Thanks for any suggestions.
  16. Sir; I have developed a website for my Department of Science, which recently is hosted in USA. The website is programmed not to accept any form submissions after 8 pm. Also it gets redirected to "Site is down" page on Saturdays and Sundays. It was OK while the site was over in-house server. Now that its in USA, because the time zone now is different, it does not accept the forms after 8 pm in USA, which is 8 am here in India. Site does not accept forms from 8 am to 12 noon here in India. Also weekend redirect to "Site is down" is of no use due to date being different in USA and in India. Is there any code in ASP or procedure in SQL 2008 R2, whereby I can convert the USA time on the server in USA to Indian Standard Time ( IST ) so that the required functioning of the site happens as per the Indian Time and not as per the time in USA? We are on shared server so the server time can not be changed. Thanks DAMODAR G AGNI
  17. Hello, first post here at W3Schools. I made an older ASP project for tracking jobs at work. Part of the ASP app saves specific job details to a MS access database table. When the job is first created in the DB, one job (root) folder with two subfolders are created on the server at that same time. serverjobs11452 serverjobs1145211452 PHOTOS serverjobs1145211452 RESEARCH set foldername=fso.CreateFolder(newpath) set foldername=fso.CreateFolder(newpath & "" & strJobFolderNumber & " PHOTOS") set foldername=fso.CreateFolder(newpath & "" & strJobFolderNumber & " RESEARCH") The structure of the job folders on the server is such that only the first time a job is created the root folder and 2 subfolders are created in the newly created root job folder (eg. 11452). Subsequent jobs with the same root job number (eg. root 11452 then later 11452-2) do not trigger the creation of an additional job (root) folder or subfolders within the job root folder. Another part of the application supports a job management page for tracking job progress as they move through the business process. The job management page is accessed with a link in one ASP page to another ASP page (passing a value to access the DB and build the page) that is created server side and returned in a new browser window. format of the link for a typical job management ASP page for jobs 11452 and 11452-2: http://server/jobs/JobMgmtResponse.asp?hdnJobNumber=11452&submit=GO http://server/jobs/JobMgmtResponse.asp?hdnJobNumber=11452-2&submit=GO How would I do this: I would like to create and place a link (shortcut?) to the job management ASP page, on the server, in the job number root folder (eg. serverjobs11452) for each job saved to the DB with the same root job number. These would be created for the first job (eg. 11452) and subsequent jobs (eg. 11452-2, 11452-C) as jobs are added to the DB Each job with the same root job number saved in the DB needs to have a link (shortcut) to the job management ASP page that can be directly accessed when viewing any particular job's root directory (eg.serverjobs11452) on the server and returned to the requesting browser. This link needs to be saved on the server in the root job folder. I've done research into this and cannot find a way to format a link or shortcut to the job's management page dynamically with ASP as a job is added to the DB then save it to the job root directory. Please give me a hand with this. I'm not sure it can be done or maybe I'm not approaching it from the right perspective. Thanks
  18. I created an asp.net webform that submits to an sql database on an sql server. The web server is Windows server 2012. The page successfully submits when I run the page using Visual Studio 2012, but when I run it on the web server (not using Visual Studios) I get the error message below when I click submit. It says login failed for user domainservername$, but the username in the connection string is user we created for the sql database. It uses Windows Authentication. I setup the web server for asp.net. I haven't done it before, so I assume the issue is there or in the connection string, though I'm not sure. The connection string is below. I'm new to asp.net, c#, and sql, so I'm learning as I go in this project. Let me know if you need anymore information. Thanks for any suggestions. <connectionStrings> <add name="MyConsString" connectionString="Server=sqlserver; Database=database; User Id=username; password=password; Trusted_Connection=Yes;" providerName="System.Data.SqlClient" /> </connectionStrings> Server Error in '/' Application. -------------------------------------------------------------------------------- Insert Error:Login failed for user 'domainservername$'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Exception: Insert Error:Login failed for user 'domainservername$'. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [Exception: Insert Error:Login failed for user 'domainservername$'.] Survey.WebForm1.ExecuteInsert(EventArgs e) in servernamec$inetpubSurvey2Surveydefault.aspx.cs:489 Survey.WebForm1.Button1_Click(Object sender, EventArgs e) in servernamec$inetpubSurvey2Surveydefault.aspx.cs:39 System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +155 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3804
  19. Hi all,urgent, I need help.I need to set up and online form where people can register their details and I need these details to gointo a speadsheet (Excel).Im asssuming its a database.How do I set that up? I was planning on using php script which grabs the detail and send it to an email but they want it to be sentonto a spreadsheet.I have never done it before and do not have a clue how its done.Can anypne help please.Many thanks
  20. am searching the code for making pdf in asp classic, i have made a form in asp and on submit button i want that it get convert in pdf and get to attached in email. thanks in advance plz help
  21. Hi, I need to fill a drop-down box from another drop-down box in an ASP using AJAX, I was following the AJAX Database example, but I don't get the data, so don't know what am I doing wrong, could anyone please help me trying to figure out what's wrong or if you have an example of how to fill a drop-down box once you change the value of another drop-down box? here is my code: AJAX.JS function showSubject(str){var xmlhttp;if (str=="") { document.getElementById("materias").innerHTML=""; return; }if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLHttpRequest(); }else {// code for IE6, IE5 xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); }xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { document.getElementById("materias").innerHTML=xmlhttp.responseText; } }xmlhttp.open("GET","materiaslista.asp?q="+str,true);xmlhttp.send();} MATERIASPAGE.ASP<% response.expires=-1 Set base=Server.CreateObject("ADODB.Connection")base.ConnectionString = "DSN=acc"base.Open strSql="Select * from tblMaterias where Carrera="strSql=strSql & "'" & request.querystring("q") & "'" set rsMat=Server.CreateObject("ADODB.recordset")rsMat.Open strSql,base response.write("<table>") do until rstMat.eof for each x in rstMat.Fieldsresponse.write("<tr><td><b>" & x.name & "</b></td>") response.write("<td>" & x.value & "</td></tr>") next rstMat.movenext loop response.write("</table>") %> STUDENTS.ASP I have: <script type="text/javascript" src="ajax.js"></script> <form method="post" action="save_data.asp?ac=1" name="Form1"><tr><td class="style5"><span lang="es-pa"><strong>Carrera</strong></span>:</td> <td class="style5"> <select name="carrera" onchange="showSubject(this.value)" > <option value="">Seleccione una carrera!</option> <%while not rstCar.eof%><option value="<%=rstCar.Fields("id")%>"><%=rstCar.Fields("carrera")%></option><%rstCar.MoveNextwend%></select></td></tr><tr> <td class="style5"><strong>Materias:</strong></td> <td class="style5"> <div id="materias">TEXTO</div></td></tr></form> Thanks
  22. Hi, This is my first topic in this forum and i hope that someone can help me = = = = = = = = = XML: <?xml version="1.0" encoding="utf-8"?><gallery><description>martens-design.be</description><album title="" thumbnail=""><description></description><image src="xxxxx.jpg" thumbnail="xxxxx_thumb.jpg"></image><image src="yyyyy.jpg" thumbnail="yyyyy_thumb.jpg"></image><image src="zzzzz.jpg" thumbnail="zzzzz_thumb.jpg"></image></album></gallery> = = = = = = = = = ASP: <%Set objXMLDoc = Server.CreateObject("Microsoft.XMLDOM")objXMLDoc.async = FalseobjXMLDoc.load("http://www.absdef.com/data/MyXML.xml")Set Root = objXMLDoc.documentElementSet NodeList = Root.getElementsByTagName("gallery/album/image")For i = 0 to NodeList.length -1 Set image = objXMLDoc.getElementsByTagName("src")(i) Set thumb = objXMLDoc.getElementsByTagName("thumbnail")(i) Response.Write image.text & " " & "<br>" Response.Write thumb.text & " " & "<br>"NextSet objXMLDoc = Nothing%> = = = = = = = = = ...but i've got nothing ...and this is what i want: xxxxx.jpg xxxxx_thumb.jpg <br>yyyyy.jpg yyyyy_thumb.jpg <br>zzzzz.jpg zzzzz_thumb.jpg <br> = = = = = = = = = Thankzzz Charlotte
  23. Hi, i need help for this error, I keep getting this error -->> "Unable to get value of the property 'innerHTML': object is null or undefined" when am running the program in IE & nothing is running in other web browsers... Below is the javascript (JScript.js) code: var output = document.getElementById('output'), pressed = {}; window.onkeydown = function (e) { if (pressed[e.which]) return; pressed[e.which] = e.timeStamp;}; window.onkeyup = function (e) { if (!pressed[e.which]) return; var duration = (e.timeStamp - pressed[e.which]) / 1000; output.innerHTML += '<p>Key ' + e.which + ' was pressed for ' + duration + ' seconds</p>'; pressed[e.which] = 0;}; Here is my asp code (test.aspx): <html><head><title>XXX</title></head><body> <h1>Keystroke Dynamics</h1> <p>Try pressing some keys on your keyboard ...</p> <script type="text/javascript" src="JScript.js"></script> <div id="output"></div></body></html> May I know the problem that cause this error & how can I correct it?? I tried the same program in php and it works but not in asp.net 2010...Thank you...
  24. Hi , It my first post on the forum but i'm a old user of your web site. My problem is in asp i need tor creat a random fonction like loto. I explain y probleme, i have an arrey like this (19,20,21,22,23,24,25) and it can be any longueur with many number other exmple (99,100,101,104,105) What i need its too place in different order like a random this array First exemple original=(19,20,21,22,23,24,25) after (22,20,24,21,23,19,25)after (20,19,21,24,23,22,25)and ... First step i do its a code to find how number of value in array.I count the array,I repalce all , by nothing ans i recount the array now i know in how i need to split my arraybut i dont how to place my value in a different order and not 2 time every value need to be there but in a different order Sorry for my english i try my best If some body have a suggest for me its appreciate. I need to do this on a looping for a multiple insert in a bd but for that its not a problem for me Thanks you Have a nice day
  25. Please Help Error SELECT AVG® AS Average FROM tform WHERE pt='Taming the Time Monster' Microsoft OLE DB Provider for SQL Server error '80040e07' The average aggregate operation cannot take a varchar data type as an argument. /hr/tform/admin/avrage.asp, line 20 Code<%strConnect ="Provider=SQLOLEDB.1;Persist Security Info=False;User ID=usrtform;Initial Catalog=hrtform;Data Source=intranet;pwd=tform123"set cn= server.createobject("adodb.connection")set rs=server.createobject("adodb.recordset")cn.open strConnect sql="SELECT AVG® AS Average FROM tform WHERE pt='" & Request.Form("id") & "'"response.Write(sql)set rs=cn.execute(sql) %> <% do until rs.EOF%><tr> <%for each x in rs.Fields%> <td><%Response.Write(x.value)%></td> <%next rs.MoveNext%></tr> <%looprs.closecn.close%>
  • Create New...