|
Within IIS - open the properties of your application and go to the directory security tab. Click the "Edit..." button for Anonymous Access and Authentication Control. Ensure that only Integrated Windows Authentication is checked.
This authenticates the users coming to this site using the users NT Logon.
In an ASP page try the following:
Response.Write Request.ServerVariables("LOGON_USER")
This gets you the domain\username of whoever accessed the page. This way you can strip out only the username (or keep the whole thing) to store in the DB along with the event.
No second logon ... no sweat.
|
|
|
|
|
Is there any easy way to transfer objects between javascript and server ?
|
|
|
|
|
What do you mean transfer objects? You can send data with GET or POST or cookies I guess.
"Two wrongs don't make a right, but three lefts do!" - Alex Barylski
|
|
|
|
|
I mean how to transfer an object but not just string to the server.
for example:
function Cat() {
this.age=5;
this.weight=6;
}
var oCat=new Cat();
how I can post "oCat" to server?
|
|
|
|
|
zhuzhenhuan wrote:
how I can post "oCat" to server?
You could create a JavaScript serialiser and serialise the object into XML and store it in a hidden input field on the page, then post that to the server. Then on the other side you could de-serialise it. That would be seriously cool IYAM.
Otherwise you must break the object up into it's properties and store them in seperate input fields or send them in the querystring.
AFAIK you can only send text data with a post.
Paul Watson Bluegrass Cape Town, South Africa Paul Watson wrote:
"The Labia [cinema]... ...was opened by Princess Labia in May 1949..."
Christian Graus wrote:
See, I told you it was a nice name for a girl...
|
|
|
|
|
That's what cookies are for. document.cookie=... R/W access .
|
|
|
|
|
hi all
I wish to handle a javascript event using a funtion that has parameters eg
funtion Init(arq)
{
myobj.onkeydown = dofunc(arq); // where arq is an array
myobj.onkeyup = dofunc(arq); // where arq is an array
myobj.onclick = dofunc(arq); // where arq is an array
}
however it doesn't want to behave when I want to use the parameters
I suspect I have to use the 'eval' function (something I think I read a long long time age) but I can't get it to work.
thanks
|
|
|
|
|
Event handlers in the DHTML Object Model do not receive parameters directly. You will need to store the parameter in a page-level variable, or as an expando property of the object. For example:
function Init(obj, arq)
{
obj.arq = arq;
obj.onkeydown = dofunc;
obj.onkeyup = dofunc;
obj.onclick = dofunc;
}
function dofunc()
{
var obj = event.srcElement;
var arq = obj.arq;
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
thankx - that is what I ended up doing in the end except I had to use a page variable as sometimes srcElement came back as null - dunno why - javascript confuses me most of the time.
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
You could use the following function to bind the argument 'arq' to the function 'dofunc'.
function bind ( f, bound_argument ) {
function fake () {
return ( f ( bound_argument ) );
}
return ( fake );
}
It works by creating a new function that does not take any paramaters itself. The resulting code might look something like the following.
funtion Init ( arq ) {
myobj.onkeydown = bind ( dofunc, arq );
myobj.onkeyup = bind ( dofunc, arq );
myobj.onclick = bind ( dofunc, arq );
}
cheers,
-B
|
|
|
|
|
thankx - that looks a better solution for what I need to do
Technically speaking the dictionary would define Visual Basic users as programmers. But here again, a very generalized, liberal definition is being employed and it's wrong - just plain wrong - Tom Archer 5/12/02
|
|
|
|
|
does anyone know how to set a custom 404 page on a website with an Apache server?
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
You use the ErrorDocument directive:
http://www.bignosebird.com/apache/a7.shtml
The link above includes some examples of how to use it.
--
Paul
"If you can keep your head when all around you have lost theirs, then you probably haven't understood the seriousness of the situation."
- David Brent, from "The Office"
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
It still does work. I have uploaded a file called .htaccess to the main dir, with the following conent.
<pre.errordocument 404="" error="" 404.php<="" pre="">
[edit]
I have just tried it with the 401 error page and it worked. It must be because my host is automatically setting a 404 error page. I will see if i can disable it some how.
[/edit]
[Another Edit]
I added pages for a load of other errors, and no it works - thanks.
[/Another Edit]
1001111111011101111100111100101011110011110100101110010011010010 Sonork | 100.21142 | TheEclypse
|
|
|
|
|
I have a website which uses ASP as a front-end for a COM based Windows service application. The ASP application does not use ASP state management, basically just has 4 ASP pages which call into my COM objects.
When I stress test the site up-to around 1000 concurrent users, it appears that IIS/ASP stalls for anywhere from 1-10 seconds on ocassion. Stress up-to 200, 400 concurrent does not reveal this problem.
When it stalls, CPU usage stays around 4-8% with all of that time going to inetinfo.exe. If it helps, there are no calls to ADO on the ASP pages. The code for the web pages basically looks like this:
<%
set objEngine = Server.CreateObject("MyComObject")
objEngine.RetrieveStateFromHandle CStr(Request("HANDLE"))
Response.Write objEngine.GetOutputHTML
%>
(Note: the COM object is exposed by a service. The COM object is marked as multi-threaded with the free-threaded marshaller.)
Has anyone seen this issue before? Any solutions out there?
|
|
|
|
|
Never mind! Thanks anyway.
In case you're wondering, the problem is with a little meaningless piece of code in the ASP files which sends an email if an exception occurs in the COM object. Exceptions are normal, but when pushed to 1000 concurrent users, the # of exceptions increased accordingly as well as the # of emails. (My email box at yahoo has 2500+ emails and is full. )
I am using the Dundas free email control which uses a direct-connect email methodology. Apparently it is taking a looooong time and because it is STA locks up IIS when more than a few of these emails must be sent at a time.
Anyway, that was a great way to spend a couple of hours.
|
|
|
|
|
I have an ActiveX control inside a HTML document. What's the best way to acquire the IHTMLDocument interface?
--
Only in a world this sh*tty could you even try to say these were innocent people and keep a straight face.
|
|
|
|
|
I'm creating a contract database that has over 80 different calculations and formulas. I'm using one table with fields and one query for formulas. I need to run/update query through the browser. Does anyone have any idea how this should be done? I'm using this SQL statement in the query, maybe there is a better SQL statement I can use to automatically update my fields in the table? Please help!
I appreciate any help from you guys.
|
|
|
|
|
I am working on a web form project where I need to upload files to a server. The first part in this process is to select the files from the users local machine. My question is how do I open a file dialog box from a web form. Can I even do this? Thanks in advance for any help you can give...
Eric
|
|
|
|
|
By your mention of WebForms I will assume that you're using .NET.
From memory there isn't an ASPX server control, but, you should be using a file element in your client side form:
<INPUT id="somefile" type="file">
This will automatically show a textbox for the URI and a browse button, which is automatically linked up to an open dialog.
When the form is submitted you will receive the contents of the file in, either the querystring (if you use GET) or in the headers section of the request (if you use POST). Either way, if you call Request("somefile") you should be able to get the contents of the file.
If you are using a more complex WebForm you may want to write your own ASPX server control wrapper for the <INPUT type="file"> element.
Tatham Oddie (VB.NET/C#/ASP.NET/VB6/ASP/JavaScript)
tatham@e-oddie.com
+61 414 275 989
|
|
|
|
|
|
As you know, there are many restrictions in an ASP page.
For that reason, I need to know how to perform some operations by another application on server.
I am looking forward any ideas.
|
|
|
|
|
There is the easy way and the (not so) hard way:
1. The easy way: go for ASP.NET
2. The (not so) hard way: use a COM component.
I see dumb people
|
|
|
|
|
I intend to use COM as a resolution but I wonder if we can use that COM to invoke an Automation such as Excel Automation inside its code ?
I have had problems in invoking Excel Automation directly inside ASP page.
Help me if you can !!!
|
|
|
|
|
as long as excel is installed on the server which will run the COM component, then you shouldn't have any trouble automating excel.
if you need any samples then let me know and i'll give you some simple demos.
|
|
|
|