Retrieving ASP session value in an included .js file


In an website editing page I have an included .js file which writes a rich text editor to the screen.\t(This doesn't work as an asp include btw)

I need to get a variable containing the page content to the Javascript file so it can display it as part of its output but am unsure of how. I have already set an asp session with the content - can I transfer this to a javascript cookie or something

I have used the method of including the .js file.

Please help.
Posted On: Monday 22nd of October 2012 12:42:59 AM Total Views:  368
View Complete with Replies

RELATED TOPICS OF ASP PROGRAMMING LANGUAGE




What session variables should I use?

Question 1Originally, we had a big "router" page to which all forms submitted, and the router page had to determine which page the logic had come from.We used Request.ServerVariables("HTTP_REFERRER")and stripped everything before the last "/" which worked fine, except that a few of our customers had problems with that because of their company's firewalls.\tI understand that due to this problem, it is not advisable to use HTTP_REFERRER.\tI reckon I can use PATH_INFO\tinstead of this, can anyone see any unforseen problems with thisQuestion 2We are going to have one physical site (in IIS) but it will be accessed from different URLs, to give us 2 or more conceptual sites.\tThen we will present the site with different branding (colours, logos etc), depending on what URL the user came from.I have not set up a URL, and am using the IP address to enter the site at present.\tWith this set-up, request.Servervariables("SERVER_NAME") gives me the correct URL, ie the IP addy.\tWill this still work when I have a friendly URL assigned to each IP address\teg if I make "elite.mycompany.co.uk" = 10.xx.xx.160, and enter the site using the friendly URL, will Server_name return "elite.mycompany.co.uk"Many
VIEWS ON THIS POST

228

Posted on:

Monday 22nd October 2012
View Replies!

Multiple sessions??

Ok , I've got this user authentication set up with access database. Now, when they put in their username, based upon what their username is, it takes them to either page1.asp, page2.asp, or page 3.asp. My problem is, is that I only set one session variable to make sure that they're logged in, but once they sign in, they are capable of viewing either page1.asp, page2.asp or page 3.asp. I need to make is so they can only access their specified page. I'm figuring I may need to set up multiple sessions based upon their username, and then check within each site which session was still active. How would I go about doing this
VIEWS ON THIS POST

229

Posted on:

Monday 22nd October 2012
View Replies!

How do I create a session ID ...

How do I create a session ID to keep track of a user ordering items from my WEB site. I want to create my own shopping cart and then jump to the secure https credit card site.Here is what I have so far got to the URL belowwww.barcodeone.com/test.aspClick the Add to cart buttonIf you look at the customer number and invoice number it increments each time, which I dont want to happen. I want to have multiple items show up on one order, not multiple orders created.Its saving it to the database OK, but again it is creating a new order number for each instead of having multiple items on one order. as shown belowSessionID\t\tInvoiceNum\t\tCustomerID\t\tPartNum\t\tDescription\t\tQty\t\tPrice\t\tDate\t\tTime\t\t983220098\t\t123920098\t\tC39\t\tCode 39 True Type Font\t\t1\t\t99.00\t\t12/21/2001\t\t11:57:55 AM\t\t983220099\t\t123920099\t\tC39\t\tCode 39 True Type Font\t\t1\t\t99.00\t\t12/21/2001\t\t12:27:32 PM\t\t983220101\t\t123920101\t\tC39\t\tCode 39 True Type Font\t\t1\t\t99.00\t\t12/21/2001\t\t2:19:16 PM\t\t983220102\t\t123920102\t\tC39\t\tCode 39 True Type Font\t\t1\t\t99.00\t\t12/21/2001\t\t2:20:50 PM\t\t983220103\t\t123920103\t\tC39\t\tCode 39 True Type Font\t\t1\t\t99.00\t\t12/21/2001\t\t2:22:56 PM--------------------------------TIA DougP, MCP\tVisit my WEB site www.barcodeone.com to see how Bar-codes can help you be more productive
VIEWS ON THIS POST

259

Posted on:

Monday 22nd October 2012
View Replies!

One session on two sites

I have two sites on the same machine (one directly under the wwwroot and one defined as a virtual directory). I am using IIS on a windows NT server.I want the users to be identified by the same session, so after he entered one site (successfuly typing username and password) and I save a session for him, I could use the same session to identify him if he goes to the second site (so he wont have to retype his username and password).For now, when I click a link I created from the first site to the second, it seems the session is not recognized (it is empty).Are two seperate sessions created for two sites Is there a way to work with one sessionThank you for your timeYael
VIEWS ON THIS POST

183

Posted on:

Monday 22nd October 2012
View Replies!

global.asa session.abandon in session_onstart routine

\t\tI have a site I must maintain that is having a problem with users logging in and seeing the wrong information.\tWhat's happening is that the user will stop using the site without closing the browser and another user will log in and still see the first user's information.\t\tI know that this is because the previous user's session hasn't expired.\tI was wondering if I could put the session.abandon command in the session_onstart routine of the global.asa before everything else.\tFor example the following:Sub Session_OnStart\t\tsession.abandon\t\t' other code hereend subI'm thinking that this will annihilate any open session and allow the next user to log in to see the correct information, but I'm wondering if there are any drawbacks to this approach and if this is even doable.Your help would be very much appreciated
VIEWS ON THIS POST

251

Posted on:

Monday 22nd October 2012
View Replies!

Is there anyway to have a form that inserts and can pass a session var

I am trying to make a page that contains a form that will insert a record when submitted and also pass the session variable "ID" to the next page..is this possible\t
VIEWS ON THIS POST

275

Posted on:

Tuesday 23rd October 2012
View Replies!

session in asp&informix

hi.. my codes about session is not working.. here's the code :sql = "select * from user where username = '" & (username) & "'"sql = sql & " and password = '" & (password) & "'"\t\t\tSet RS1 = Server.CreateObject("ADODB.Connection")\t\tRS1.open "DSN=test;UID=informix;PWD=informix"\t\tSet RS = RS1.Execute(sql)If RS.BOF And RS.EOF Then\t\tResponse.Redirect "loginfail.asp"Else\t\t\t\tsession("design") = RS("designation")\t\t\t\tif session("design") = "admin"\t\t\t\t\t\t\t\t\tresponse.redirect "admin.asp"\t\t\t\t\t\t\telse\t\t\t\t\t\t\t\t\tresponse.redirect "user.asp"end ifend ifif the RS("designation") value is admin.. it still go to the user.asp and not to admin.asp..and i've tried this without using sessions, like\t\t\t\t\tif RS("designation") = "admin" ...but, it still doesn't work.. but, it works if i use microsoft access database.. but why cannot in informix.. please help.
VIEWS ON THIS POST

168

Posted on:

Tuesday 23rd October 2012
View Replies!

Javascript retrieving SQL 2000 datetime

Could anyone tell me how to retrieve a date field under a SQL 2000 database table, which has "datetime" data type So I could plug into the var1 = new Date(...). Javascript format. Thank you.
VIEWS ON THIS POST

245

Posted on:

Friday 26th October 2012
View Replies!

help!! problem retrieving value from recordset

Hi ! I'm stuck at trying to retrieve a value from a recordset in the following scenario: Code:
VIEWS ON THIS POST

301

Posted on:

Friday 26th October 2012
View Replies!

retrieving values from multiple selection listbox and storing it

hi guyz, i want some help in how to retrieve values from multiple selection listbox. i want the values retrived to be used in the search which i perform from the database. i m doing a search feature which u all often see in job search sites. so someone selects multiple cities to search in i want that to include that in my search query. plz.........guyz its really very urgent. if u can provide me with some nice good example or some code...........
VIEWS ON THIS POST

298

Posted on:

Friday 26th October 2012
View Replies!

retrieving a form from Access 2k

I've created a form in Access and want to view it from web site. How can I retrieve this from my ASP page so that the user can pull the form from the database
VIEWS ON THIS POST

201

Posted on:

Friday 26th October 2012
View Replies!

help with retrieving values from one page to another

Can anyone tell me is it possible to pass the values from one page to another page using normal button not submit button in ASP. I am able to pass value using submit button but not with normal button. I tried to retrieve values using request.form and request.querystring method both, but not able to do.
VIEWS ON THIS POST

274

Posted on:

Friday 26th October 2012
View Replies!