First I would question why you want to do this. If they get to the page by any means it should respond appropriately, whether refresh or by link. This is a stateless environment after all.
That being said...
I would take the approach of setting a session variable that gets set the first time they hit the page:
<%
if session("NotTheFirstTime") = "" then
'write the onload
session("NotTheFirstTime") = true
end if
%>
then based on that variable write or don't write the onload.
Of course, if the user can access the page from multiple links and the onload is valid for each link, regardless of how many times they hit the page, this won't work....
I'm trying to write an ASP interface that mimiks a .Net datagrid control. I'm having a problem when I'm in the middle of an Edit, Update, or a New Record.
If the user hits the wrong button, the program grabs the values in the textboxes using the request.form() and then redisplays them in the textboxes when the records table gets written back out to the page. This works fine as long as the form is submitted.
If it's just a page refresh (F5), the program doesn't get the latest changes to the textboxes and displays either a blank or whatever was in there the last time the form was submitted. Anybody got any ideas?
I have an online application made up of ASP pages (IIS 5.0 on Windows 2000 Server) drawing data from a SQL Server database. Most of the time, everything works exactly as it should. Connections are opened to the database, queries are run and data is returned and writen out, connections are closed, etc.
However, every so often a page simply won't load. It isn't trying to load and then timing out or anything, it's like it's ignoring the page entirely. It shows the correct URL in the address bar of IE, but there's nothing but a blank white page displayed. Viewing the source of the blank page reveals that instead of the correct code for the page, we get this: Code:
we're running IIS 5 and trying to do a simple update to a code behind file (Login.aspx.vb) we copy the file over to the server, but we're not seeing the updates. the server is still reporting errors on line numbers in the file that no longer exist. we've even stopped / restarted the service, with no luck.
i've created a simple web app that allows users to enter in information about a project in a web form and save that information to a database (Access). After a user enters in all the information, she can click on a link to go to an index.asp page that displays all the projects that have been added.
the problem i'm having occurs after the user enters in all their project information. when the user goes to the index page, the index page is suppposed to retrieve all records and display them, but it doesn't.
even after hitting the Refresh button in the browser, it won't display the latest project that the user just entered. however, if i add a second project and then go back to the index page, it will work fine and display both the first and second projects. so, it's like the first project won't be displayed until i enter in another project after it (like the first project is stuck). does anyone know what the problem may be?
I have a web site where I use cookies to navigate between the pages. The cookie is his id no which is nothing but his staff id no. All most all pages are dynamic and connected to sql server 2000 through ADOs. My problem is :
if any one logs in and enter bowse the pages and goes back uses other log in his old page is displaced rather than new one, untill he explicity uses the refresh button. Once he does that , it is working. Iam using javascript menus to navigate between pages.Previously when menus are not there pages were working fine.
here is some background on the page I made. It's a calendar page with events listed. No database, just used id="" to display certain months depending on the option chosen from the jump down menu.
The question I have is this: I would like to display the current month's events when they land on the page. I used
<% id=request.querystring("id") %>
and created an <%elseif id="1" then%> and so on for each month. Is there a way can request the month and display that id? Thanks for you help. I have the code for the page if need be
Is there a way to determine the actual width and height of a image file ? I'm using aspsmartupload to upload the image, how can determine and save the width and height value ? seems that aspsmartupload doesn't have this property. If so, is there any method to determine it in asp in the simpliest way? I will prefer to maintain the aspsmartupload method.
I have many servers which will be reghosted everyday with different OS (Win2000, Win2003, WinXP...). How could I write the ASP code to get the information of other servers' OS?
Let say the asp page is hosted on Server A, how can I check the OS version of Server B and Server C?
Somewhere in my program I ask users to provide their website URL. I would like to determine if the given website exists or not.How can I determine a website with given URL exists?
I am creating an ASP page for members of my team to add and delete records from specified tables. This table is choose by the user and I am dynamically creating text boxes. I also wish to include the type of the attribute to assist the user.
<% for s_intCounter=0 to objRs.Fields.Count -1 %><tr> <td width="34%"><% objRs.Fields.Item(s_intCounter) %>: <input type="text" id = <% objRs.Fields.Item(s_intCounter) %> > </td>
<td width="66%">Type: <% INSERT ASP FOR RETRIVING TYPE</td> </tr> <%next%>
I want to use asp to assign a css class to <td> tag. I was thinking an If statement, but i've not come across trying to assign a class to a table cell before! I want the cell background to be highlighted red determined by a database table with - yes or null. (null remains white, yes - red) At the moment it simple like this: Code:
My web hosting account lets me use ASP and so I thought I'd try to learn and use some. There is only one thing that I would like to know, and that is how to find out what version of ASP is running. Preferably, what I am looking for is something similar to the PHP php_info() function. Is there anything like this for ASP?
I have an ASP/ADO application querying an SQL Server DB. I want know the most efficient way to determine if more than one row is returned from a query. If more than one row is returned, the user will be presented with a choice of which row to process. If only one row is returned, I want to skip this stage, and process that single row immediately.
I can think of a number of ways of acheiving this (eg. .recordcount) but I'm looking for the slickest and most efficient method.
This may be a trivial question, but I was wondering how can you determine if a value contains an Integer or Float. I know there is a function called IsNumeric, however you can't determine what type it is.
I built a simple scheduling application using an access db.
The relevent fields are eventRoom, startDate, startTime and endTime.
When I go to add a new event, what method can I use to make sure the eventRoom is available for the selected date and time slot? Id like to just display an alert with the conflicting times and suggest the next available startTime.
I need to figure out if this file is over a day (or however many hours) and if it is, i need to delete it. If its not i redirect the user to it Code:
If (fs.FileExists(workFile))=true Then set f=fs.GetFile(workFile) If (f.DateLastModified > Date-1) Response.Redirect "/" & tFileName & "/" & reqString & ".html" Else f.Delete End If set f=nothing End If
obviosuly the date-1 is wrong, i can't fid the appropriate syntax to save my life.
Just wondering if anyone knows how to determine someones connection speed in asp the reason for this being so i can redirect the user to a different media file depending on their connection speed.
I have a recordset with two three fields. One is an autonumber field called ID , one is a text field called Name and the last is a date/time field called DateEntered. How can I programatically determine the autonumber field ? Code:
is there anyone here who can help me to determine google's pagerank with asp code. Just like pagerank tools are doing, where do they request data from, how do they get it, etc..
how do i determine how many items are in an array? the following code creates an array of values each time a space is found in a name field. the problem is that sometimes names have middle initials and sometimes they do not. so i want to determine how many items exist in this array created bythe split BEFORE assigning values:
I have a database i want to be able to determine its size from an asp page, Also is it possible to list tables and column names list what tables are in the database and column names of each table contained?
I have an asp script that lists the files in a directory:
CurrentPATH = "c: emp" Set oFSO = CreateObject("Scripting.FileSystemObject") Set oFolder = oFSO.GetFolder(CurrentPATH) Set oFolderContents = oFolder.Files For Each oFileItem in oFolder.Files ..... next
before doing the "For..Next" loop, I want to determine the number of files in oFolderContents. How can I do this? Is there another way to determine the number of files in a given directory?
I am connected to a MySQL db and I want to see whether a certain user already exists.
Set MyConn = Server.CreateObject("ADODB.Connection") MyConn.Open "my_dsn" 'check if the user exists existing_user_query = "SELECT * FROM admins WHERE username = '"& vUser&"'" Set RS_existing = MyConn.Execute(existing_user_query)
when I am testing for the RS_existing.RecordCount property, I am always getting '-1'. it might not be supported on the server I am using.
Our central site has set up a VPN for us so we can access our network from home. Unfortunately, our Intranet won't come up. We've been told it is because the Intrusion Prevention System on the firewall is blocking it because the headers are too large. How can I determine how large the headers are?
Would it be the total of all of the Request.ServerVariables? They tell me the default settings are 2000 bytes. Which seems awfully small to me.
I've got a subroutine, defined as Private, takes two parameters, that is called lots of times from different ASP scripts. I need specific error handling when it is called from only one particular section of my code - and from the page it's called from, it's called multiple times from there, too, so I can't check by page.
I thought about adding an additional parameter, but it's called so many times that it would be unwieldy to do so.
Is there a way I can tell a Private Subroutine what piece of code called it?