469,894 Members | 2,159 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,894 developers. It's quick & easy.

Bit lost (inherits/imports) for secure login...

Hi all,

ok - the scenario...

We have a secure login page known as the Clinical Portal (single login
etc) - we have a web user control for this which checks if a session is
available or not and redirects the user to the Clinical Portal to login if
not etc.

I have dragged the .ascx (SessionCheck.ascx) across and thought all was well
until I tried to pick up one of the created sessions within the page_load
for my page - it seems that the order of events happening is that the
page_load for my main page is firing before the page_load on the .ascx etc
therefore the session has not yet been created - result - I get bounced back
to the login page.

I checked to see what a colleague has done (he's away at the moment and cant
ask etc) - it seems that he took the code for the session checking out of
the page_load within the .ascx and put it in a Sub

Sub CPUser()

firstly - is this ok? Should it be private sub, public sub or any other
kind (we're all quite new to .net)...

ok - assuming that that is indeed ok - I assume that to then use that on a
page I would need something like

Call CPUser()

however when I've tried this I got the following error :

Name CPUser is not declared

I took another look at his code and at the top of the .vb file for his page
he has

Imports application_name.SessionCheck

so I added the same - now I get this error :

Reference to a non-shared member requires an object reference.

I have no idea what this means - so I looked at his code again - this time I
also spotted the following inherits line :

Inherits application_name.SessionCheck

When I added this I was given another error telling me I could only have ONE
inherits statement, I currently have :

Inherits System.Web.UI.Page

So - now I'm completely lost - if I remove the lines above (imports,
inherits and call etc) then my page still works, but theres obviously not
session checking going on.

Can anyone give me any pointers as to how I should be using the .ascx file -
ie, how I include the code in my page - I must preferred the initial way of
just dragging and dropping the .ascx file because I was hoping that this
could be easily built into our template, rather than having to add some code
to each and every page..

If anyone can help I'd be grateful - I've not posted any code as there's a
fair bit of it, but if its needed I can happily post it up..


Nov 18 '05 #1
0 944

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by deko | last post: by
3 posts views Thread by jty202 | last post: by
2 posts views Thread by sck10 | last post: by
10 posts views Thread by Tony Abate | last post: by
1 post views Thread by Arpan | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.