|
document.location is the way to do it. e.g. document.location = "http://www.codeproject.com/lounge.asp";
It is the DOM standard way.
Gecko DOM reference. Gecko is the engine that Netscape 6+, Mozilla, Firebird etc. runs on. It is even useful for IE6 because it is most of the W3C DOM and most modern browsers support a good level these days.
regards,
Paul Watson
Bluegrass
South Africa
Anna-Jayne Metcalfe wrote:
"Cynicism has it's place in life - but it should be kept well away from your inner self."
Crikey! ain't life grand?
|
|
|
|
|
Hello,
I would like to copy a particular file from one place on the server to another in an ASP.NET code behind page using c#. I know it can be done using vbscript with something similar to the following code:
SET oShell = Server.CreateObject( "WScript.Shell" )
cmd = "cmd.exe /c copy " & originalPath & " " & destinationPath
rval = oShell.Run (cmd,0,TRUE)
SET oShell = Nothing
I don't actually know what WScript is or does (haven't found a lot of documentation on it). When I try similar code in c#, it says I'm missing a directive.
Does anyone know how to use WScript.Shell with c#? Or, is there a better way to accomplish this with out using WScript.Shell at all?
Thanks for your help,
RC
|
|
|
|
|
Why do you even want to use WScript? Just use the classes in System.IO . You can copy, create, delete, move etc. files and folders.
regards,
Paul Watson
Bluegrass
South Africa
Anna-Jayne Metcalfe wrote:
"Cynicism has it's place in life - but it should be kept well away from your inner self."
Crikey! ain't life grand?
|
|
|
|
|
Hi,
I'm still rather new to .NET so I didn't know that System.IO had all of these functions. I tried
System.IO.Directory.Move(file1,file2)
and it worked like a charm. Thanks for your help!!
RC
|
|
|
|
|
Cool chubbysilk, glad I could help.
Another tip is to put a Using System.IO; at the top of your CS file and then you can just use Directory.Move(file1,file2); without the namespace reference.
regards,
Paul Watson
Bluegrass
South Africa
Anna-Jayne Metcalfe wrote:
"Cynicism has it's place in life - but it should be kept well away from your inner self."
Crikey! ain't life grand?
|
|
|
|
|
Hi,
I just ran into one small problem. The System.IO.Directory.Move function works when I copy a file from one folder to another on a single drive. But I am unable to copy a file from the C drive to the E drive. Do you know how to get around that?
Thanks again,
RC
|
|
|
|
|
|
I would like to create a link that will download a file. I know how to do this with a file that does not contain any special characters, however I am having difficulty when the file does contain special characters. Examples of filenames I am attempting to down load are the following:
#_Online Test (NDP's).ucn
cs7101-2part+1mcp.ucn
What do I need to do to download these files from a link within an ASP page.
Thanks in advance.
|
|
|
|
|
Hi,
I'm having problems intercepting the events thrown by an activex control when it is instantiated in a pop-up window.
I am using the <object> HTML tag to instantiate the control within a page. Let's call this page the ocxtest.htm. To intercept the events of the OCX in this page, I use the following syntax:
<SCRIPT LANGUAGE="javascript" FOR="MyObject" EVENT="EventName">
<!--
alert("Hello")
//-->
</SCRIPT>
The OCX is created within a form in order to access some properties and methods from other JavaScript blocks.
If I open directly the page by requesting the URL in my Browser, the event is intercepted and the alert() is executed.
The problem occurs when I want to have ocxtest.htm as a pop-up window, for example, calleng this code from another page:
window.open( "ocxtest.htm", "MyOcxWindow", "width=550, height=500, left=200, top=30");
In the MyOcxWindow, the control is rendered fine, I still have access to the properties and methods and the functionality works properly, however the events thrown by the OCX are no longer intercepted by the window, in other words, in a pop-up window the alert() in the sample code above is never executed.
So,
Are ActiveX controls' events handled in pop-up widows at all?
Is there any extra step that I should take when the control resides in a pop-up window?
Thanks.
|
|
|
|
|
It is a shame!
Hi! I am from China. Our pretty SMART officals of Education Ministry think it is a good idea to use Internet to do the processes of enter for the master entrance examination to prevent hundreds . But they are so SMART that they let some jackaroos to build the system. They use Apache Tomcat and JSP. The system is so slow and it crashed at the first morning it runs.
How to solve to problem?
I think the possible solution is to use Win2003,IE6,ASP.NET and Win Cluster as the Web Server, and use MTS as the connection to SQL Server 2000.
Will it work?
Is there any better way?
Let's roll!
|
|
|
|
|
As much as I am a Microsoft developer Apache Tomcat and JSP run some pretty big rigs out there with ease. They are scalable technologies.
What I am saying is that it is the way those jackaroos have coded the app that is the problem, not the technologies. So switching technologies is not going to help much.
If you and your team are doing the rewrite and are more comfortable in MS tech then use that, or LAMP if your resources know it better. Just make sure your architecture which is pretty technology agnostic is well designed.
regards,
Paul Watson
Bluegrass
South Africa
Anna-Jayne Metcalfe wrote:
"Cynicism has it's place in life - but it should be kept well away from your inner self."
Crikey! ain't life grand?
|
|
|
|
|
Yeah. But what I want to know is how to well design.
Let's roll!
|
|
|
|
|
Thats what studying and work experience provide... Noone can explain to you how to properly design...
Thats why Analysts and Software Designers are paid thousands of dollars!!!!!
I sugget you outsource the job to people who know how to do it...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
Hey! I don't do this business. I just want to learn!
Let's roll!
|
|
|
|
|
What I was trying to say is that you cant learn to properly design software on a message board...
As I said, read books, take some courses... or outsource the job to people who know how to do it...
theJazzyBrain
Wise is he who asks good questions, not he who gives good answers
|
|
|
|
|
I'm gathering a HTML page (a report) from different sources - images, text, table (converted to HTML) - and some other HTML source.
Now I could just embed the external documents <body> contents in the report page - which would be perfect (for my needs) - except for a style sheet in the external documents header. I could avoid that, but I'd like to know what other options I have - like an iframe - how compatible ist that, and can I have the iframe's source in the same page? what with a CSS-style-definition-block inside the body, what would happen when these such definitions repeat in the report document? Any other options?
TIA
Peter
"Vierteile den, der sie Hure schimpft mit einem türkischen Säbel."
mlog || Agile Programming | doxygen
|
|
|
|
|
IFrames are supported from IE 4+ and Netscape 4+, so unless your clients are backwards you won't have any problems.
The IFrame ignores the containing documents style definitions (sometimes I wish it wouldn't).
And what do you mean by " can I have the iframe's source in the same page?" ?
regards,
Paul Watson
Bluegrass
South Africa
Anna-Jayne Metcalfe wrote:
"Cynicism has it's place in life - but it should be kept well away from your inner self."
Crikey! ain't life grand?
|
|
|
|
|
In-Line Frames are a great implementation of the frames idea — they allow you to open new pages properly inside main pages, without the many problems brought about by classic-style frames. In-Line Frames are a new tag in HTML 4.0. They started as an Internet Explorer only tag, and so have been supported since IE3.0 and above. Netscape 6 and Opera 4 also now support them, but Netscape 4.7 skips over them.
|
|
|
|
|
I am working on my first .NET web project. I have a web application that has 3 web forms. I am using C# for the client side scripting. Here is how it works: The user selects an option (two links) off the first page. Then select a file to load (excel sheet) on the second web form and press the "Load file" button. It can take several seconds (@10-20) to load the data and post it to the third web form. What I want is a way to change the cursor to an hourglass after the "Load" button is pressed and before the data shows on the next pages web form.
Is this possible? And where would I put the code, on the 2nd web form with the load button or the 3rd where the data will be previewed?
Your help is appreciated.
Thanks,
John
|
|
|
|
|
I have specified in a CSS stylesheet diferent colors for A:Link, A:Active, and A:Visited. Specifically, A:Active is defined to be red, yet when I display the current page its link is shown as a light blue. Shouldn't it show as red, or am I missing something trivial, yet important?
"Your village called - They're missing their idiot."
|
|
|
|
|
Active does not mean that style should be applied to a link when you are on that page. It should but I have never seen a browser do it reliably.
When you click the link and the browser is navigating to the new page, that is when most browsers apply the Active style.
You need to do your own "current page" link implementation.
regards,
Paul Watson
Bluegrass
South Africa
Marc Clifton wrote:
"organically fed captivity free regurgitated bee nectar" (honey) on dieting.
Crikey! ain't life grand?
|
|
|
|
|
Paul Watson wrote:
You need to do your own "current page" link implementation
does it mean that I should check for the links and check for the cur page and make the corresponding STYLE assignment?
Is there any other scripting that can help this?
I was born intelligent Education ruined me!.
|
|
|
|
|
Most the time you really don't need to worry. It is only for main navigation that you want to indicate which page/section the user is currently in.
Generally you would have your normal nav link styles and then one called current.
Then on each page you would apply that style to the nav element e.g. a href="blah.html" class="current" .
You can of course automate this in your backend code or even via JavaScript.
regards,
Paul Watson
Bluegrass
South Africa
Marc Clifton wrote:
"organically fed captivity free regurgitated bee nectar" (honey) on dieting.
Crikey! ain't life grand?
|
|
|
|
|
Paul Watson wrote:
You can of course automate this in your backend code or even via JavaScript
This is what I was looking for
I was born intelligent Education ruined me!.
|
|
|
|
|
Paul Watson wrote:
When you click the link and the browser is navigating to the new page, that is when most browsers apply the Active style.
Actually, they apply it any time the link has focus, which includes when you click on it.
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|