|
I'm trying to improve on this and also get the page which had the link to the missing page. I'm trying to use the history object:
document.write("window.history.length=" + window.history.length + "<br/><br/>");
etc...
Problem is I can't work out how to access element n out of the history array. I tried window.history[1] etc. but that doesn't work and the w3 schools doesn't seem to have any more info on it.
Anybody know the syntax for this?
-- modified at 0:12 Friday 30th December, 2005
|
|
|
|
|
Due to privacy issues, you cannot see the history. The only way to access this is to use the window.history.back() method. Yeah, it kind of sucks, but think about what it would mean if sites could see where you've been.
Michael Flanakin
Web Log
|
|
|
|
|
That makes sense. But I was under the impression that you could at least get to the page that linked to this one. Otherwise your log files wouldn't be able to tell you where your referrals came from right?
|
|
|
|
|
Did you try document.referrer ?
Michael Flanakin
Web Log
|
|
|
|
|
I thought I had tried document.referrer last week and couldn't get it to work but just tried it again now and it seems to work okay. Thanks again!! Problem solved and a solution found thanks to all your help
|
|
|
|
|
Not a problem. Note that you won't get a referring page if you go directly to the page. That only exists if you click a link to browse to a page.
Michael Flanakin
Web Log
|
|
|
|
|
By the way, I was kind of wrong. You should set window.location.href , not just windows.location . It's been a while :-P I think it might work either way in IE, but specifying the href property is the correct way.
Michael Flanakin
Web Log
|
|
|
|
|
Thanks Michael - I'll correct that.
Any ideas about the history object?
|
|
|
|
|
I the new one for asp and I got a problem about open file with this structure
---------- -------------- ---------------
| Client | | Web Server | | File Server |
---------- -------------- ---------------
When client click link to open file, Program get file path form database(file is in File Server)
My code use window.open(filepath). With this code it seem like client open file direct form file server and it not excatly true. How can i do to make web server get file from file server.
Thank you
-_-?????
-- modified at 5:40 Wednesday 28th December, 2005
|
|
|
|
|
Are you using ASP or ASP.NET? Either way, you'll have to create a web request on the back end to grab the file from the file server. Then, you'll have to change your content type and output the file as the response. The user will get an open/save dialog and go from there.
Michael Flanakin
Web Log
|
|
|
|
|
Thank for your advise. Can I grab file with FTP to webserver and how can i do it with "ASP".
|
|
|
|
|
Yes you can do it. The only problem that I see would be to pass user credentials. If you don't have any, then it should (theoretically) be the same as any other "screen-scrape"-style request. If it does require authentication, you'll have to check Google for a script.
http://www.google.com/search?q=asp+ftp[^]
Michael Flanakin
Web Log
|
|
|
|
|
I have a link that re-directs me to a new page.
click here link redirects to page1.asp?id=19 how can I password protect the
page1.asp?id=19 page?
|
|
|
|
|
Whenever you want to password protect a page, just put a condition at the begining of that page.
Save all the usernames and passwords in a database (say in a table called 'visitors'). Each time a user logs in check if the passwords he enters (you can also use a cookie) matches the one in your database.
If it does just use a flag in his session that enables him to get in the site. Else, just redirect him to a page saying "wrong password".
<br />
if session("access") = "no" then<br />
response.redirect "access_denied.asp"<br />
Isaac
|
|
|
|
|
hi all,
how can i pass id along with wndow.open()
vipin
|
|
|
|
|
plz let me know wht actually u wanna do
Any systematic work reflects its significance for a long time, Though I m not totally against "The Prototyping".So let's discuss in depth...
|
|
|
|
|
if you want to open any page dynamically, create a function in javascript with page name as parameter.
Any systematic work reflects its significance for a long time, Though I m not totally against "The Prototyping".So let's discuss in depth...
|
|
|
|
|
use query strings:
<br />
window.open("pagename.aspx?id=yourid",null,<br />
"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");<br />
regards,
Mircea
Many people spend their life going to sleep when they’re not sleepy and waking up while they still are.
|
|
|
|
|
thank u for this reply
here "yourid" may be a text value??
window.open("pagename.aspx?id=documnet.form1.txtno.value",null,
"height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
is it possible??
vipin
|
|
|
|
|
Hello Dears,
I have written a code to insert record in to DB(SQL SERVER), Its working fine.
The problem is - some time the records are getting duplicates,
How to avoid this kind of problem?
Why such a kind of problem cause?
Thanks
N.Rajakumar B.E.,
Application Developer,
|
|
|
|
|
in case you are implementing a postback event handler and your insertion code is present in the handler, then when you refresh the page immediately after you have made a postback for insertion , the same process will occur again, causing the isnertion code to be invoked. There are lot of ways to get around the problem, some are
1.In your commit handler, check whether it is a refresh or a genuine commit.
2.Implement the insertion in a stored proc where you can place checks to see if the data exists
|
|
|
|
|
The most probable reason for this is that the code actually is executed twice. This can be from users double clicking the submit button, or from an error in your code.
---
b { font-weight: normal; }
|
|
|
|
|
What initiates the insert? Is it the end user clicking a button? If so, the problem might be from impatient users clicking twice. Try disabling the button using javascript before submitting the page. This will not let them click it again, causing a second insert.
Michael Flanakin
Web Log
|
|
|
|
|
hi all,
i have asp page with repeater in it, inside repeater i have a hidden field a text field and some td's with just text.
i want to be able to access the updated text from each row of the repeater when a user clicks submit button. it appears that these values are not appearing at postback but the repeater row controls are recreated on postback and viewstate restored to them
if i have 2 in my textbox and type 3 then submit, when stepping through debug i get value 2 not 3.
can anyone provide a solution or alternative please? surely something like this is possible, i just cannot find anything googling or in my books
kind reagards,
g00fy
|
|
|
|
|
How can I check when Webbrosercontrol (VS 2005) has loaded the Page completely?
IsBusy and the ControlState(Completed, Loading, Loaded ... the enum) - doesn't work
|
|
|
|