All I want to do, is insert to a database the username, log in time, and IP address of a user when they log in. This would literally take a few lines of code in PHP, but after requesting help in several forums and trying many different solutions it seems to be an impossible task for ASP.
The closest I’ve gotten is adding this to the front aspx page (where it redirects after logging in):
if (Request.IsAuthenticated)
The problem is I can not get it to do an insert after that to save my life. Selects into grid view? No problem. Insert data on page load? No way.
I can not believe that no one has ever encountered this before.
Other notes
-
The site will not load into Visual Studio.
-
I’ve attempted to edit the .cs files in the temp directory, but nothing seems to happen
-
I’m editing the .aspx files in the webroot directory.
-
I’d be more than happy to use straight C#, but I have no idea how to add to the middle of an aspx page
Sounds like you’re working with a pre-compiled site – so, editing the code is doing nothing?
If you have complete control over the code, then it should be a simple matter to do an insert into a database in that event handler – we do that all the time. Are you using standard ADO code or trying to use some databound control or something? Just a straight up ADO call would be enough…
You know… this stuff…