asp-classic

Set SessionId in Classic ASP?

妖精的绣舞 提交于 2019-12-12 03:48:52
问题 In PHP I can choose to use a particular Session by using Session_id() as a setter. Is there any similar functionality in Classic ASP/VBScript? I have an VBScript site that, depending on the page, is either called directly from the browser or internally via HTTP. Unfortunately ASP treats these as two separate sessions, because the User's computer calls one and the Server itself calls the other. I want to tell the Server calls, "Hey, use Session 123456" so it can share info with the user

Generate an error if number is repeated in a form

本小妞迷上赌 提交于 2019-12-12 03:39:56
问题 I have a web form for admin purposes where the user can change the order that a group of records is shown on a webpage. For example: A table (tblStuff) in a database has three fields: ContentID, Content, RecordPosition The table has, say, four records: 1, Guess what, 1 2, More stuff, 2 3, Some stuff, 3 4, That's right, 4 The SQL code is: SELECT * FROM tblStuff ORDER BY RecordPosition ASC The user can use the form to change the RecordPosition number so that the order can read: 3, Some stuff, 1

How can I call asp page with parameters from html link?

感情迁移 提交于 2019-12-12 03:38:15
问题 I´m trying to call asp page from html link but with paremeters. Is that possible? <li><a href="#" onclick="<% Response.redirect("myurl with parameters")%>">Caducados</a></li> I know why this fails but is there any way to do this? 回答1: You can pass them in a conventional link; <a href="page.asp?a=b&c=<%=serverval %>&d=e">Caducados</a> If you need client side processing <a href="#" onclick="goTo('val1', '<%=serverval %>');">Caducados</a> and a js helper; function goTo(a,b) { location.href =

Finding Tuesday for the whole year in ASP Classic

孤者浪人 提交于 2019-12-12 03:26:58
问题 im refereing to this post here. vbscript asp - Find every Thursday in a given month How im supposed to do it if i wanna find the tuesday for the whole year? let say 2016? I did try as below based on the code from the post i mentioned above, but it will return me only for August, instead of whole year base_date = cdate("21 aug 2016") 'get 1st thursday; thurs = dateserial(year(base_date), month(base_date), 1) 'response.write(weekday(thurs)) if (weekday(thurs) <> 1) then thurs = 3 - weekday

IIS 7 Classic ASP session for website, website subdirectory, application inside website

旧街凉风 提交于 2019-12-12 03:23:33
问题 Environment : Win server 2008 R2, IIS 7.5 Website : MainWebsite MainWebsite\Subdirectory MainWebsite\VirtualDirectory For MainWebsite - ASP -> (Session Properties) -> Time-Out -> 00:04:00 For MainWebsite\Subdirectory -> ASP -> (Session Properties) -> Time-Out -> 00:08:00 AppPool -> (Process Model) -> Idle Time-Out (minutes) -> 10 [I set it to 10 minute] Requirement : I want the MainWebsite to hold the session for 4 minutes. I want the MainWebsite\Subdirectory to hold the session for 8 minutes

If username not exist “INSERT INTO” Else “UPDATE” (display info)

不打扰是莪最后的温柔 提交于 2019-12-12 03:19:17
问题 this is my table: <table> <tr><td><b>Utilizador:</b></td><td><asp:Label ID="username" runat="server"></asp:Label></td></tr> <tr><td><b>Telefone da Empresa:</b></td><td><asp:TextBox ID="empresa" runat="server" MaxLength="13"></asp:TextBox> (Exemplo: +351234925xxx)</td></tr> <tr><td><b>2º Telefone:</b></td><td><asp:TextBox ID="empresa2" runat="server" MaxLength="4"></asp:TextBox> (Exemplo: xxxx)</td></tr> <tr><td><b>Telemóvel:</b></td><td><asp:TextBox ID="telemovel" runat="server" MaxLength="13

Connecting to MS Access Database within ASP (an architecture mismatch)

流过昼夜 提交于 2019-12-12 03:12:11
问题 Ok, I have searched and read other posts and other areas from Google but still am struggling. I have created a small ASP page which loads and functions as planned. I've created a small MS Access Database in MC Access (2003 - 32bit) and later I had another go with MS Access (2010 - 32 Bit) When I've added a connection string into my ASP Page I get: Microsoft OLE DB Provider for ODBC Drivers error '80004005' [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch

Programmatically determine whether a window is standalone or orphaned

天大地大妈咪最大 提交于 2019-12-12 03:09:36
问题 I have a need to figure out whether a window was opened as a standalone vs. whether it was orphaned. Let me illustrate what I mean. Let's say I have two ASP pages that I'll call PARENT.asp and CHILD.asp. Additionally, there is a redirect page that I'll call CHILD-REDIRECT.asp. When a certain button on CHILD.asp is clicked, it redirects to CHILD-REDIRECT.asp, which includes client-side Javascript code that needs to run a certain way, depending on whether or not it has a parent (based on window

upload a file via a form using ASP

試著忘記壹切 提交于 2019-12-12 03:08:37
问题 I have a simple html form in a .asp page. I would like add a field to let users upload files via the form on my server/ftp on the fly. Any suggestions on how I can do this please? this is the code I am using for the HTML <form name="formUpload" id="formUpload" method="post" enctype="multipart/form-data" action=""> <table valign="top" align="left" bgcolor="PaleGoldenRod" width="300px" border="0" cellspacing="0" cellpadding="0"> <tr bgcolor="PaleGoldenRod" valign="top"> <td width="300px">

vbscript dropdown in function without using HTML (classic ASP)

随声附和 提交于 2019-12-12 02:59:32
问题 I am working on a classic asp page with a pre-existing vbscript function that forms a document. Is there a way to make a dropdown within vbscript itself that doesn't depend on HTML? I have an xml object with what is needed to load the dropdown but I need to load the actual dropdown. Luckily, it just needs to print on the form, there is no save to a database. There isn't much code to post except that it would go in a function such as: Function getDropdownA(ByVal strInput) ' put dropdown here,