I need to update a sql table with the last date/time that a user logged into
my web site. The site is protected via integrated authentication. I can put
code in the global.asax file to update when a user hits any page in the site.
Is there any code I can put in to capture if a user tries to access a .PDF
file in the web site ? For example the user can open a broswer and request
http:\\mywebsit e\application1\ test.pdf. This action does not appear to fire
off any events in the global.asax that is in directory
\\mywebsite\app lication1.
Any help would be appreciated. thanks 4 2315
Basically what I need is an event fired when someone requests a .pdf file on
my web server.
"jzink" wrote: I need to update a sql table with the last date/time that a user logged into my web site. The site is protected via integrated authentication. I can put code in the global.asax file to update when a user hits any page in the site. Is there any code I can put in to capture if a user tries to access a .PDF file in the web site ? For example the user can open a broswer and request http:\\mywebsit e\application1\ test.pdf. This action does not appear to fire off any events in the global.asax that is in directory \\mywebsite\app lication1.
Any help would be appreciated. thanks
Yes, you can route requests for the .PDF file extension thorugh the
ASP.NET runtime. This would allow you to examine the request in the
events of the HttpApplication in global.asax.
This KB article will tell you how to edit the script mappings to route
ther file extensionsf through the asp.net pipeline: http://support.microsoft.com/default...b;EN-US;815152
It goes on to show how to deny access to the new file types, which is
not what you want to do, but it does have all the other instructions
you need.
HTH,
--
Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 13 Oct 2004 14:26:53 -0700, "jzink"
<jz***@discussi ons.microsoft.c om> wrote: Basically what I need is an event fired when someone requests a .pdf file on my web server.
"jzink" wrote:
I need to update a sql table with the last date/time that a user logged into my web site. The site is protected via integrated authentication. I can put code in the global.asax file to update when a user hits any page in the site. Is there any code I can put in to capture if a user tries to access a .PDF file in the web site ? For example the user can open a broswer and request http:\\mywebsit e\application1\ test.pdf. This action does not appear to fire off any events in the global.asax that is in directory \\mywebsite\app lication1.
Any help would be appreciated. thanks
Thanks for the reply. That's exactly what I was looking for. 1 more question:
I am using basic authentication on my site, which always prompts the user
for id/pwd when the site is first accessed. Is there an event in the
global.asax that will fire after the user provides his/her credentials ? I
don't want an event that will fire for every request.
"Scott Allen" wrote: Yes, you can route requests for the .PDF file extension thorugh the ASP.NET runtime. This would allow you to examine the request in the events of the HttpApplication in global.asax.
This KB article will tell you how to edit the script mappings to route ther file extensionsf through the asp.net pipeline:
http://support.microsoft.com/default...b;EN-US;815152
It goes on to show how to deny access to the new file types, which is not what you want to do, but it does have all the other instructions you need.
HTH,
-- Scott http://www.OdeToCode.com/blogs/scott/
On Wed, 13 Oct 2004 14:26:53 -0700, "jzink" <jz***@discussi ons.microsoft.c om> wrote:
Basically what I need is an event fired when someone requests a .pdf file on my web server.
"jzink" wrote:
I need to update a sql table with the last date/time that a user logged into my web site. The site is protected via integrated authentication. I can put code in the global.asax file to update when a user hits any page in the site. Is there any code I can put in to capture if a user tries to access a .PDF file in the web site ? For example the user can open a broswer and request http:\\mywebsit e\application1\ test.pdf. This action does not appear to fire off any events in the global.asax that is in directory \\mywebsite\app lication1.
Any help would be appreciated. thanks
Hi Jzink:
No, there is no direct event that will fire at that point. The server
doesn't really know when the browser is prompting the user, it only
knows if a request has credentials associated with it or not.
--
Scott http://www.OdeToCode.com/blogs/scott/
On Thu, 14 Oct 2004 06:23:04 -0700, "jzink"
<jz***@discussi ons.microsoft.c om> wrote: Thanks for the reply. That's exactly what I was looking for. 1 more question: I am using basic authentication on my site, which always prompts the user for id/pwd when the site is first accessed. Is there an event in the global.asax that will fire after the user provides his/her credentials ? I don't want an event that will fire for every request.
"Scott Allen" wrote: This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: ElmoWatson |
last post by:
I tried on the Security newgroup, as well as other places, and haven't
gotten an answer yet - - I'm pulling my hair out over this one.
I'm trying to get Forms Authentication working.....I can get any requested
page to automatically go to the Login.aspx page, AND, the ReturnURL
querystring is correct in the address bar, but no matter what, I can't get
it, once the user is authenticated, to redirect to the new page. It ALWAYS
refreshes the...
|
by: francois |
last post by:
hello,
I am using forms authentication and I would like that my authentication
cookie expires after let say 1 minutes (just for the exemple).
When I log in in my longon page, the user has to input a username, password
and the click a button to effectively login.
In the event handler for my button I have the following code:
// create authentication ticket and encrypt it
|
by: AVance |
last post by:
Hi,
I've come across this scenario in ASP.NET 1.1 with forms authentication
where the forms auth doesn't seem to timeout correctly, nor redirect to the
login page.
I have done some testing, and I believe I've found a solution, but I
would like some insight from Microsoft on whether the code I've implemented
is correct, and why it is even working.
Here is my scenario:
|
by: Sean Patterson |
last post by:
Hey all,
I've followed the examples online on how to use Forms Authentication to
create a ticket, assign it a role, and then intercept it in the
Global.asax file to make sure it gets sucked in to the IPrincipal. This
has worked on some other apps, but my code isn't working in my new one
for some reason. Here's my CreateCredentials code:
Private Sub CreateCredentials(ByVal UserID As String, ByVal UserRole As
String)
|
by: Sean Patterson |
last post by:
Hey all,
I've followed the examples online on how to use Forms Authentication to
create a ticket, assign it a role, and then intercept it in the
Global.asax file to make sure it gets sucked in to the IPrincipal. This
has worked on some other apps, but my code isn't working in my new one
for some reason. Here's my CreateCredentials code:
Private Sub CreateCredentials(ByVal UserID As String, ByVal UserRole As
String)
| |
by: Archer |
last post by:
I was making a role-based authentication but it does't login with
correct password.
the HttpContext.Current.User recieved in Global.asax is always null.
Request.IsAuthenticated is always false.
in the cs files, i write the code below
protected void SubmitBtn_Click(Object sender, EventArgs e)
{
|
by: Tod Birdsall, MCSD for .NET |
last post by:
Hi All,
I have two ASP.NET applications which I am trying to have share forms
authentication. But I am running into problems.
App A is an ASP.NET 2.0 Beta 2 application. App B is an ASP.NET 1.1
application (Telligent's Community Server) compiled with VS.NET 2003.
App B runs in a virtual sub-directory of App A. Both applications run
fine. Both site's ASP.NET tabs are set appropriately (A = 2.0.5X B =
|
by: Stu |
last post by:
Hi,
Im using vis studio 2003 and I think wse is out of the question as clients
could be using java which doesnt support it. So I managed to find some code
which allows you to develop a custom soap header called by using a http
module. The problem Im having is I cannot seem to get the event to raise to
fire off my authenticate method in the global.asax. The module is plumbed in
to my web.config file
Code Below:-
|
by: Peter Bradley |
last post by:
We are in the process of designing our first ASP.NET 2.0 application and
have discovered that Forms Authentication works completely differently in
ASP.NET 2.0.
For a number of reasons, we cannot use the standard login component supplied
with ASP.NET 2.0 (e.g. we need full control of the look and feel - including
using CSS and not tables for layout - and we need to be able to handle the
authentication cookie ourselves rather than let a...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |