| Author |
|
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/21/2006 at 3:44pm | IP Logged
|
|
|
hi again...
does the 'testsessionupdate' code still work in the new dll as asp.net is saying when i use it that 'HttpContext.Current.Session("testsessionupdate") is not declared... and i copied the code straight through...
any ideas?
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/21/2006 at 5:58pm | IP Logged
|
|
|
I assume you got that from here ?
http://support.cjwsoft.com/code/moreinfo525-1.htm
That code runs by itself and has nothing to do with the dll.
Regardless, though all of that should still work fine (it seems to work for me with the new dll) there really isn't a reason to use with the new dll since it can set all the session info for you..
unless your trying to set your own additional fields or something ?
Still that code should work fine.. the DLL version should not effect it.. I don't see how it could ?
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:21am | IP Logged
|
|
|
well i'm using it to get the user's password out of the database... and its still saying the same thing... take a look yourself..
http://www.flesso.com/testprotect.aspx
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:26am | IP Logged
|
|
|
If you want the users password dont use that. It already exists in a session variable once the person is logged in ?
Why are you using that to try to get the password?
Either grab it from the session variable or do a simple database query and grab it.. no reason to be doing all that.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:27am | IP Logged
|
|
|
oh ok... i didnt realise the password variable was set... i didnt see that
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:32am | IP Logged
|
|
|
now its saying...
System.NullReferenceException: Object reference not set to an instance of an object.
when i:
"Dim Password as String = HttpContext.Current.Session("Password")"
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:33am | IP Logged
|
|
|
actually.. I am wrong, your right
that session variable does not get set.
I still don know why your getting an error with that simple code.. it works for me here. It has to be something your doing. It's not related to the dll in anyway.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:35am | IP Logged
|
|
|
it must be my server... as I'm copying and pasting the code straight through... with no alterations except to the fields i want out of the db
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:38am | IP Logged
|
|
|
well, were still over-complicating things
If you need the password after login try this.. no need for any of that testsessionupdate crap.. you really dont even need to use session variables for your purposes... you can put the stuff in between while and end while in regular variables, but that is up to you
That code I gave was just an example of one way to do it.. try this.. its a lot less complex.. you just have to make sure your logged in or it it will fail as the session variable for the username wont exist
Dim ASPPConnStr As String = ConfigurationManager.AppSettings("ASPPConnStr") Dim ASPP_tbl_label_users As String = ConfigurationManager.AppSettings("ASPP_tbl_label_users")
Dim ASPPdbconn, ASPPsql, ASPPdbcomm, ASPPdbread ASPPdbconn = New OleDbConnection(ASPPConnStr) ASPPdbconn.Open()
ASPPsql = "SELECT " & ASPP_tbl_label_users & ".* FROM " & ASPP_tbl_label_users & " WHERE (Username = '" & HttpContext.Current.Session("Username") & "')"
ASPPdbcomm = New OleDbCommand(ASPPsql, ASPPdbconn) ASPPdbread = ASPPdbcomm.ExecuteReader()
While ASPPdbread.Read()
' Add whatever fields from the database you like here HttpContext.Current.Session("First_Name") = ASPPdbread("First_Name") HttpContext.Current.Session("Last_Name") = ASPPdbread("Last_Name")
End While
'Clean up data connections
ASPPdbread.Close() ASPPdbconn.Close() ASPPdbconn.Dispose()
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:41am | IP Logged
|
|
|
hmmm now it says that 'ASPPConnStr' not delcared.. cud it be some bad value in the web.config file?
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:44am | IP Logged
|
|
|
That's pretty goofy since it is definetely being declared. I really don't know, but you got something weird going on.
Are you using ASP.NET 1.1 or 2.0 for this web application?
This code is all for ASP.NET 2.0 as far as grabbing values from the web.config goes.
What version of ASP.NET is this web site assigned to in IIS ?
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:47am | IP Logged
|
|
|
.net 2.0
the dll is 2.0
2.0 is assigned in iis...
restarted the site in iis...and its still the same
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:49am | IP Logged
|
|
|
I dont know then.
What happens if you make a protected page with just this code?
Dim ASPPConnStr As String = ConfigurationManager.AppSettings("ASPPConnStr")
do you get an error ? You need to break things down and find out what part is really giving you your problem.
If that works with no error then try adding a response write to see if the value is really there.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:51am | IP Logged
|
|
|
its fine when i add just that... but when i use the rest of the code it says 'declaration expected'... i've just rebooted my server... hope that makes a difference
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:54am | IP Logged
|
|
|
ok.. its rebooted now... and no difference whatsoever... is it just me or is my server being a right sh*t??
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:57am | IP Logged
|
|
|
like I said man.. step by step..
add some more code... you need to figure out what part is causing the problem..
You do realize when you use the OLE stuff you have to add the namespace to the page or it won't work ?? As talked about here. http://support.cjwsoft.com/code/moreinfo525-1.htm
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 3:59am | IP Logged
|
|
|
found the problem...
this part:
ASPPdbconn = New OleDbConnection(ASPPConnStr)
i've been through it line by line now... and thats the problem line
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 3:59am | IP Logged
|
|
|
ok then it is what I just said, you didnt add the namespace
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 4:01am | IP Logged
|
|
|
the namespace has been there all along...
<%@ Import Namespace="System.Data.OleDb" %>
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 4:03am | IP Logged
|
|
|
well, it cant be working/right if this line gives your trouble
ASPPdbconn = New OleDbConnection(ASPPConnStr)
did you response.write ASPPConnStr to make sure it contains the connection string information ?
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 4:04am | IP Logged
|
|
|
well... heres the code for the whole of the page:
<%@ Page Language="VB" Debug="True" ContentType="text/html" %>
<%@ Register TagPrefix="aspprotectauthentication" TagName="checkaccess" Src="protectpage.ascx" %>
<aspprotectauthentication:checkaccess CHECKFOR="" GROUPACCESS="" runat="server"></aspprotectauthentication:checkaccess& gt;
<%@ Import Namespace="System.Data.OleDb" %>
<!--#include virtual="/scripts/Encryption.aspx" -->
<!--#include virtual="/scripts/GetPassword.aspx" -->
<script language="VB" runat="server">
Dim ASPPEncryptionKey As String = ConfigurationManager.AppSettings("ASPPEncryptionKey")
Dim Password As String = HttpContext.Current.Session("Password")
</script>
<HTML>
<HEAD>
<LINK rel="stylesheet" type="text/css" href="ASPPstyles.css">
<script language="VB" runat="server">
Sub Page_Load(Src As Object, E As EventArgs)
Welcome.Text = "Hello"
End Sub
Sub Signout_Click(Src As Object, E As EventArgs)
FormsAuthentication.SignOut()
Session.Abandon()
Response.Redirect("testprotect.aspx")
End Sub
</script>
</HEAD>
<body>
<h3><asp:label id="Welcome" runat="server"></asp:label></h3>
<form id="SignoutForm" runat="server">
<asp:button id="SignoutButton" onclick="Signout_Click" runat="server" text="Signout"></asp:button></form>
<% Response.Write ("Username = " & HttpContext.Current.Session("Username") & "<br>") %>
<% Response.Write ("Admin = " & HttpContext.Current.Session("Admin") & "<br>") %>
<% Response.Write ("Access_Level = " & HttpContext.Current.Session("Access_Level") & "<br>") %>
<% Response.Write ("Groups = " & HttpContext.Current.Session("Groups") & "<br>") %>
<%=RC4(Password, ASPPEncryptionKey)%>
<% Response.Write ("Email = " & HttpContext.Current.Session("Email") & "<br>") %>
</body>
</HTML>
-------------------------
Encryption.aspx is the RC4 function is .net that you sent me... and GetPassword.aspx is the snippet in this thread...
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 4:06am | IP Logged
|
|
|
just do this on an .aspx page all by itslef and tell me if you get a value or not when run
Dim ASPPConnStr As String = ConfigurationManager.AppSettings("ASPPConnStr")
Response.Write (ASPPConnStr)
You got way too much going on at the moment.. and using include files like that with ASP.NET isn't the best idea..
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 4:09am | IP Logged
|
|
|
error: BC30188: Declaration expected.
line: Response.Write (ASPPConnStr)
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 4:15am | IP Logged
|
|
|
well, if something as simple as that gives and error you got major problems.. I mean that is as simple as it gets..
I dont know... try it like this
Dim ASPPConnStr As String = ConfigurationSettings.AppSettings("ASPPConnStr")
Response.Write (ASPPConnStr)
Also, I take it your not using visual studio ? As your dont seem to be mentioning any debugging errors that would usually pop up...
Using visual studio really makes it about 10 times easier to troubleshoot.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 4:18am | IP Logged
|
|
|
im using dreamweaver... but ill try and debug it on vs later as thankfully i do have it
still the same error.. i think i'll just give up for now.. theres obviously something up with my server...
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 4:22am | IP Logged
|
|
|
I really dont know but this is all basic ASP.NET stuff.. the same stupid stuff that gave me trouble when I started with ASP.NET
ASP.NET IS EVIL
All I know is my tooth hurts like hell. I am getting really sick, and I am going to sleep.. I probably wont be back on the forums until well after thanksgiving.. later
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 1:37pm | IP Logged
|
|
|
if you think of any different ways to make this work or how to get it working it would be much appreciated... and thankyou for your help anyway...
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 1:53pm | IP Logged
|
|
|
I been thinking about and trying stuff here and I have come to the conclusison it is just something your doing.. I dont know what, but I cant really get involved in this sort of thing..
You have to learn ASP.NET.. you have to expirment until you start doing things the right way and the way that works.. I can not support that process..
I mean all that stuff your doing with includes.. the code you showed me.. it not the way ASP.NET is supposed to be done. Includes are the Classic ASP way of doing things. You should be putting that function into a control or something and using it that way.
Basically, I gave you that function telling you I would not support you using it and it turns into the thread from hell trying to troubleshoot basic ASP.NET stuff not related to my authentication DLL. I am sorry but I am no longer going to keep posting on this one. I just can't get stay invloved when I know it's something on your end related to basic ASP.NET coding issues.
When you cant retrieve a basic value from the web.config file you got problems. I don't think it is your server either. It's just something your doing. Just not sure what..
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 1:56pm | IP Logged
|
|
|
oh.. ok
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 1:58pm | IP Logged
|
|
|
Best thing I can tell you right now is start using Visual Studio.NET 2005.. get the ASP.NET 2.0 Unleashed book and spend about 3 weeks going through it all. That's what I did and that is what it took to really start getting comfortable with .NET and doing things the right way.
Just so you know I have been working on the users area and admin area in ASP.NET again. I worked on it around 30 hours this week alone and I really plan to release it in a month or so. No guarantees on that release date, but just so you know I am on it and I'll tell you about it 1st. I sorta got most of the hard stuff done and I am cleaning it up/making it work with encryption.. etc etc etc still a lot of work
As for dreamweaver.. it's great, BUT I really just can't see anyone doing anything productive with ASP.NET with it. You need Visual Studio.NET 2005 or even the FREE Visual Web Developer 2005 Express Edition if you want to really get into ASP.NET and start doing things visually as well as with code.
Microsoft even released a whole bunch of awesome video tuturials for the Express Edition. They can really help you if you go through them all.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 2:08pm | IP Logged
|
|
|
ok... just ordered the book...
i just realised what i did wrong and ive started getting somewhere... that sample you showed of response.writing the connection info now works. it seems that I dont know the difference between <script runat="bvlahh"> and '<%>'
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 2:11pm | IP Logged
|
|
|
hey man,
I stumbled along with .NET for a couple years.. trying to do things too much like regular ASP.. etc etc
Finally I forced myself to learn things the right way. There is no way I could have made the Authentication DLL otherwise. If you think what your doing now is tough you should see that is involved in that code. It's wild. I spent like 100 hours just on that easily. Granted a lot of it was trial and error and testing time.
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 2:16pm | IP Logged
|
|
|
wow... i just took it slowly... and hey presto... all the encryption stuff it working!!!!
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
flesso Member


Joined: June/15/2006
Online Status: Offline Info: 75
|
| Added: November/22/2006 at 2:54pm | IP Logged
|
|
|
oh... and i saw that you said you've been working on admin area and stuff in .net... will that be free to download?
__________________ Best Regards,
Josh Hold
|
| Back to Top |
|
| |
cwilliams Admin Group

CJWSoft Web Software Developer
Joined: April/06/2004
Online Status: Offline Info: 1729
|
| Added: November/22/2006 at 4:04pm | IP Logged
|
|
|
for you yes.. cause you bought a ton of stuff.. for others it will be the difference in price between it and the authentication dll.
Now quit asking questions for a while. LOL
__________________
Best Regards,
Christopher Williams
www.CJWSoft.com
|
| Back to Top |
|
| |