I have some cookies created with javascript, I need to be able to delete them (by expiring them) or set their contents to nothing ("") using ASP. However, when I try to do this, it doesn't work. If I try to set their values to nothing by doing:
for each x in Request.Cookies
response.cookies(x)=""
next
It just creates a duplicate of each of the cookies with no content.
If I try to expire the cookies by doing the following:
for each x in Request.Cookies
response.cookies(x).Expires=date-1
next
It does nothing. They don't expire.
How can I get ASP to recognise and modify the actual cookies which are there?
I want to delete all the cookies which are created for the application.If i know the names of a cookies i can delete the cookies or i can set the expire properties.
I am reading and setting a cookie using JavaScript in the BODY onload and onunload events respectively. This works fine.
However when I use ASP to set the cookie under some condition where I want to override the last value set in the onunload event, it has no effect. The next onload still has the old value.
The following code simulates the problem I experience....
In my Session_OnStart in Global.asa, I am setting some cookies. One of them, I set as follows:
dim UserID UserID = Request.ServerVariables("LOGON_USER") Response.Cookies("User")("ID") = UCASE(UserID)
When I immediately log the cookie value retrieved from Request.Cookies("User")("ID") into the Windows Event Log, I get the correct value. However, when I try to retrieve the cookie on the home page of my application using the same code,
Request.Cookies("User")("ID"), it either cannot find the cookie or cannot read the value. I am retrieving the cookie before all HTML headers are written. It is my first statement on the page after Option Explicit. I have even compared the session IDs. The SessionID created in the Session_OnStart is the same value as the SessionID on the home page.
I have read that the Session_OnStart only has access to the Application, Session and Request objects. It does not explicitly say that it does not have access to the Response object. Also, I was even able to use Response.Write's in Global.asa to print out the values although it looked like it had also stopped the session after I did so. Cookies are definitely enabled on my machine. I have even tried setting the session cookie's expiration to be persistent for a few days to see if it was perhaps expiring before I was able to read it but this did not work either.
Is there something preventing cookies to be created in Global.asa in the Session_OnStart sub? Is the Response object not available??? Please let me know if anyone else has had this problem or solution.
Is it possible for a user to enable permanent cookies but disable session cookies.....this seems like a contradition yet this is what I appear to be reading in online articles?
I m creating a cookies in my application and it work properly but i can't see the cookies where it will sotred i checked the cookies folder but i didn't find that I want to create a cookies file as the other web site create and store where other cookies will stored in Cookies folder or Temprory Internet files folder eg:1. arvind@google.co[1].txt this stored in cookies folder 2. arvind@msn[2].txt ....
Using the below tage, i successfully add a new Record to my Videos table but the varibale i declare with the newly created rs ID is always blank? Code:
I am facing a strange problem in my application. Its a ASP application. I have a drop down one page. When I select a value from the drop down, its an ASP call, after processing ,new session starts. This doesent happen for the first 3 or 4 times when i select the value from the drop down.
Also I noticed that when the new session is created , the old session is still alive. Can You suggest me as to Y the Web Server tries to create the new session, when the existing session is still alive.
After restart some time is everithing ok. After some hours - some days, problem start. Only in pool, where dll VB6 is used, aspx pages (asp ok) does not work.
Event: Failed to execute request because the App-Domain could not be created. Error: 0x8007000e Not enough storage is available to complete this operation.
Source: ASP.NET 2.0.50727.0 Event ID: 1088
OS: Windows 2003 Server SP1
HW: dual Xeon, 4GB RAM, Server is not Domain server. dll VB6 is used in pool where aspx pages does not work, in other pools aspx pages work.
The session_onstart event will fire for every pull BECAUSE no SESSIONID cookie is ever created and the server has to assume that every HTTP REQUEST frame is a new session. The response object is actually just setting a header, of course.
Every redirect is sending a header to the browser equivalent to a "meta refresh" and that once again triggers the session_onstart.
I am trying to do a simple INSERT into SQL. I've done it tons of times before with the same code, but this time is is placing duplicate entries in the table. Any ideas why this would be happening? Here is my ASP code doing the form processing:
<% set conn=server.createobject("adodb.connection") conn.Open "Driver={SQL Server}; Server=SERVERNAME; Database=DATABASENAME; UID=USER; PWD=PASSWORD" set rs = Server.CreateObject("ADODB.RecordSet")
I'm having a problem dynamically creating an UPDATE query that will write the string value of an existing record set field into a data base.To be more concrete, I can generate a string that looks like this:
UPDATE Person SET Person.name='objRS("oldname")'
but when I try to execute it, the literal objRS("oldname")gets written into the oldname field of the Person table, as opposed to the value 'Betty'. (In a separate write statement, I've already checked that objRS("oldname") prints 'Betty'.)
And if I change it to:
UPDATE Person SET Person.name=objRS("oldname") I get an error saying there is an undefined function 'objRS' in expression. Can anyone help me? If I can get this to work I'll be done with this task.
I run a website that reads our own databases and makes the data available to our users. However, recently someone has sent me a link to a php page that contains data they want me to display on our site. The php creates a csv formatted text string.
Example : I type in www.somewebsite.php and the page returns game1,gamedate,gametime,hometeam,visitor,,,, with real values of course being in these values. the ,,, are null fields that have no value as they expect our website to fill in this data for them from our users. how do I read this data with asp into a recordset, or a database?
I have an asp.net application that generates dynamic images (charts). When I run the application in debug mode from visual studio, or refer to the url with localhost in the name, everything works fine. When I try to access the site with the full machine name (not using localhost), or from another machine, the dynamic images only appear as red x's.
I've searched the groups, but can't find anything that seams to relate. I am assuming this is some sort of security setting, which I have messed around with in IIS as well.
I'm using PerlScript in my ASP page and I have the following problem: Each time the page is refreshed a CSV file is created. I want this file to be available for download. The problem is I can't create the file in the "wwwrootsite" dir, so I can't link to it. I can however create anywhere else on the server.
Is it possible to assign permissions on the fly as you are creating a directory structure on the web server?
I want to create a new folder for each new user of this system I built. Each folder will have the same permissions and will be used for uploading images. Should I just have write permissions on the parent folder and have the folder permissions inherited from the parent? Or is there a better way to do it?
I'm struggling with this problem: in a website I developed, XML files are created by users of the site to describe. The creation is OK, the (new) file is present, but it can not be read by any website visitor.
How can the default permission become at least readable?
It's a ASP script running on W2K, using the FileSystemObject component.
I have files in a folder that I am using the FileSystemObject to read. I can read the files and display links to them no problem, what I want to do is to sort them by date created.What is the best way to go about this?
Just installed VS2003 and tried a hello world app. Getting 404 error even when I explictly specify the start page in the url.
In IIS Mgr (v 5.1), App has .aspx mapped to C:WINDOWSMicrosoft.NETFrameworkv1.1.4322aspne t_isapi.dll.
The file in question IS in the virtual directory and this is the inetmgr log file entry that occurs when my browser requests the page: 19:42:27 127.0.0.1 GET /UP1/WebForm1.aspx 404 Code:
When I use a host file entry to point to the host header of the site that I have created on a Win2k server running IIS5, a cookie is not created to hold the session id. The result is that Session_OnStart is run every time a page is requested.
If I set up a DNS entry on the DNS server it all works fine.
I never noticed this problem before we put in Active Directory so it may have something to do with that.
I have set "allow per session cookies" to promt(under Custom Secrity settings in IE) to see if this is being attempted and it is not. So the browser is not even trying to create the session cookie when using the host file.
I am having trouble loading the result of a VBscript split function into an array. The script is supposed to take the user's login name (the form for this is name separated by underscores such as john_foo or lisa_wilson), split it at the underscores, and load first, middle and last name into an array. The problem I keep getting though, is that I am getting a type mismatch error. Here is the code:
<%dim LogName, NameArray(), FirstName, LastName, MiddleName, LastPage 'Get NT authorized login info LogName = request.servervariables("logon_user") NameArray = Split(LogName, "_") for x = 0 to UBound(NameArray) response.write NameArray(x) & "<br>" next %>
The FirstName, MiddleName, LastName vars are supposed to take the array values later.
When i create a folder through file system object and then check the properties of that folder, read only attribute is checked. At this time after creating the folder i need to put files in the folder and i get error due to this reason. Is it possible to make sure that read only attribute is not checked.
Also at the company we use active file component to Upload the files. Active file provides the functionality of file system object too. I have created the folder through this and the result is the same.
I'm using ASP 3.0,IIS and Java script.I have created some text boxes Dynamically using java script.So the text boxes has got the same name. This is the code i'm using for that..
Problem is that when i'm doing client side validation using javascript its not taking values..Here 2 or 3 or 4 text boxes with the course will be created when i use this code:
I've gotten a subroutine to almost work as I want it to, but it's refusing to show the newest file. It seems to choke on files created near midnight, just never showing them at all, and the date compare is showing an equal number for two different dates, though it surely shouldn't.
The code is running here: http://www.devedia.com/wiki/
The object is to show most recent file first, oldest file last. I have some leftover code in here to organize files by month created, but I removed the folders for debugging. The program moves any files created the previous month into a folder on the first of the month.
The folder name passed in is an X for recent files, a folder name (like 2005_04) when the files were sorted by folders.
What I'm hoping for from the intelligent people in the forum is either an eyeball on the subroutine to help me find where it's losing the midnight/most recent files, or a better idea on sorting by created date using the file system object and asp only. (NO recordset objects.)
And here is the subroutine. (sorry about the indenting... copy and paste it to read it better?)
My company needs an online form that user's can enter information into and once submitted, will dump the user-supplied info into a csv file and email it to the person who heads up the project. Initially, I thought they wanted the form to save the data to a database, and after playing all weekend, I was able to do that. Today I learned that they prefer the emailing a csv file method instead. Any links to tutorials on this subject or sample code with explanation would be greatly appreciated!
I am trying to create a bookstore WebApplication using c#. I can display the books (obtained from sql server) on a table in a WebForm. At the end of each row, I would like to add "add to cart" button. Therefore, I use
Button bt_add = new Button(); bt_add.Text = "Add to cart";
and put it in a cell which is later placed in each table row. The Buttons display fine on the WebForm. However, I don't know how to add the Button_Click function for each of the Button I created since I don't know the total number of books in advance. Can anyone help me get "add to cart" button to work?
Note: I try clicking on each Button, the WebForm page loads back to its original stage (Page_Load function) and my search result is gone.
i have a page which displays a list of events searched for by a particular date. we usually have a lot of events and i don't want the user to have scroll through all of them, especially if they're interested in a particular type of event.
i have created a dynamic drop down menu which consists of all the event types. how can i got about displaying the events returned by the query to a specific event for that date.
so for example, if some one searches for 03/08/2005, they will initially get a list of all events for that day. if they click on "Closed" from the drop down menu, it will display all the "Closed" events for 03/08/2005.
I created a web page from Excel2000, using "Save as web page..."...Publish function. then, I moved htm file to my IIS web server. Then I added a form control, and submit button.
How can get the data on the excel file using ASP from server side? For example, the value of Cell(1,2), Cell(2,3)....