Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: PLEASE HELP - Question on passing values to another page & launching popup box


Message #1 by msavoy@h... on Fri, 12 Apr 2002 14:31:33
There is a DLL created by one of my colleages that checks to see if a 
logged in user has permissions to access to any ASP page within our 
application.  Currently the process is that when a logged in user is for 
example on page 1 and clicks a link to get to page 2, page 2 contains 
code that utilizes this DLL to checks to see if this user has permissions 
to access this page.  If the user does not have permissions to access 
page 2 then the user is redirected to another ASP page that lists what 
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=" & 
strU

My task is to that when the user does not have permissions to access page 
2 then keep the user on page 1 but display a pop-up box that states they 
do not permissions to access this feature.  The user can then close the 
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing 
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks.  
Message #2 by "Craig Flannigan" <ckf@k...> on Fri, 12 Apr 2002 14:31:41 +0100
Could you not make Page 1 only show a list of selections they are allowed
into?

Rather than making the check when they select one.

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: 12 April 2002 14:32
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for
example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=" &
strU

My task is to that when the user does not have permissions to access page
2 then keep the user on page 1 but display a pop-up box that states they
do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks.

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of
Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp
Message #3 by msavoy@h... on Fri, 12 Apr 2002 14:45:02
This is what I have to work with.  Plus it would be a huge rewrite for 
the application.


> Could you not make Page 1 only show a list of selections they are 
allowed
into?

Rather than making the check when they select one.

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: 12 April 2002 14:32
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for
example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=" &
strU

My task is to that when the user does not have permissions to access page
2 then keep the user on page 1 but display a pop-up box that states they
do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks.

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of
Kingfield Heath Ltd. For further information visit
http://www.star.net.uk/stats.asp


_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service on behalf of 
Kingfield Heath Ltd. For further information visit 
http://www.star.net.uk/stats.asp
Message #4 by "Jerry Diegel" <diegelj@g...> on Fri, 12 Apr 2002 08:37:47 -0500
You could have page 1 pass a value in the querystring, "sender=3Dpage1". 
 Then do something like:

If Not objUser.HasAccess Then Response.Redirect 
Request.Querystring("Sender") & ".asp?Error=3DNoAccess&u=3D" & strU

Then put something like the following on the top of page1.  If your 
doing this all over the site, go ahead and make it an include file.

<%
If Request.Querystring("Error") =3D "NoAccess" then %>
<SCRIPT ID=3DclientEventHandlersJS LANGUAGE=3Djavascript>
<!--

function window_onload() {
	alert('You do not have access to that feature!');
}
//-->
</SCRIPT>
%>
End IF%>


Your main drawback with this system is that your going to be making 
roundtrips to the server everytime access is denied.  I'm guessing your 
object is using server variables to determine what page the user is on.  
An alternative method would be to create a new object that determines 
whether or not the user has access to page2 while your building page1.  
That way you can have the link call a javascript function that puts up 
or alert, or not show the link at all.

Hope this helps,

Jerry

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: Friday, April 12, 2002 9:32 AM
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for 

example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has 
permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=3D" 
&
strU

My task is to that when the user does not have permissions to access 
page
2 then keep the user on page 1 but display a pop-up box that states they 

do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks. 

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #5 by msavoy@h... on Fri, 12 Apr 2002 15:02:16
Thanks for your time and helpful response.  I will try it!!


> You could have page 1 pass a value in the 
querystring, "sender=3Dpage1". 
 Then do something like:

If Not objUser.HasAccess Then Response.Redirect 
Request.Querystring("Sender") & ".asp?Error=3DNoAccess&u=3D" & strU

Then put something like the following on the top of page1.  If your 
doing this all over the site, go ahead and make it an include file.

<%
If Request.Querystring("Error") =3D "NoAccess" then %>
<SCRIPT ID=3DclientEventHandlersJS LANGUAGE=3Djavascript>
<!--

function window_onload() {
	alert('You do not have access to that feature!');
}
//-->
</SCRIPT>
%>
End IF%>


Your main drawback with this system is that your going to be making 
roundtrips to the server everytime access is denied.  I'm guessing your 
object is using server variables to determine what page the user is on.  
An alternative method would be to create a new object that determines 
whether or not the user has access to page2 while your building page1.  
That way you can have the link call a javascript function that puts up 
or alert, or not show the link at all.

Hope this helps,

Jerry

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: Friday, April 12, 2002 9:32 AM
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for 

example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has 
permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=3D" 
&
strU

My task is to that when the user does not have permissions to access 
page
2 then keep the user on page 1 but display a pop-up box that states they 

do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks. 

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #6 by "Drew, Ron" <RDrew@B...> on Fri, 12 Apr 2002 15:08:48 -0400
................page 1...............add a hidden field to form ..
...Change the submit button to open a new window called page 2
<INPUT TYPE=3Dhidden name=3D"ErrorMsg">
................page 2...............do your check for permissions and
if ng execute a javascript

opener.document.forms[0].ErrorMsg.value =3D 'You do not have access';
self.close();
..........since you opened a new window the self.close will bring you
back to page 1 with the message


-----Original Message-----
From: Jerry Diegel [mailto:diegelj@g...]
Sent: Friday, April 12, 2002 9:38 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: PLEASE HELP - Question on passing values to
another page & launching popup box


You could have page 1 pass a value in the querystring, "sender=3Dpage1".
Then do something like:

If Not objUser.HasAccess Then Response.Redirect
Request.Querystring("Sender") & ".asp?Error=3DNoAccess&u=3D" & strU

Then put something like the following on the top of page1.  If your
doing this all over the site, go ahead and make it an include file.

<%
If Request.Querystring("Error") =3D "NoAccess" then %>
<SCRIPT ID=3DclientEventHandlersJS LANGUAGE=3Djavascript>
<!--

function window_onload() {
	alert('You do not have access to that feature!');
}
//-->
</SCRIPT>
%>
End IF%>


Your main drawback with this system is that your going to be making
roundtrips to the server everytime access is denied.  I'm guessing your
object is using server variables to determine what page the user is on.
An alternative method would be to create a new object that determines
whether or not the user has access to page2 while your building page1.
That way you can have the link call a javascript function that puts up
or alert, or not show the link at all.

Hope this helps,

Jerry

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: Friday, April 12, 2002 9:32 AM
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for

example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has
permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=3D" 
&
strU

My task is to that when the user does not have permissions to access
page
2 then keep the user on page 1 but display a pop-up box that states they

do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks. 

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #7 by "Drew, Ron" <RDrew@B...> on Fri, 12 Apr 2002 15:29:57 -0400
Forgot to mention in my reply...you also need to unhide the message
field on the form before returning

-----Original Message-----
From: Jerry Diegel [mailto:diegelj@g...]
Sent: Friday, April 12, 2002 9:38 AM
To: ASP Web HowTo
Subject: [asp_web_howto] RE: PLEASE HELP - Question on passing values to
another page & launching popup box


You could have page 1 pass a value in the querystring, "sender=3Dpage1".
Then do something like:

If Not objUser.HasAccess Then Response.Redirect
Request.Querystring("Sender") & ".asp?Error=3DNoAccess&u=3D" & strU

Then put something like the following on the top of page1.  If your
doing this all over the site, go ahead and make it an include file.

<%
If Request.Querystring("Error") =3D "NoAccess" then %>
<SCRIPT ID=3DclientEventHandlersJS LANGUAGE=3Djavascript>
<!--

function window_onload() {
	alert('You do not have access to that feature!');
}
//-->
</SCRIPT>
%>
End IF%>


Your main drawback with this system is that your going to be making
roundtrips to the server everytime access is denied.  I'm guessing your
object is using server variables to determine what page the user is on.
An alternative method would be to create a new object that determines
whether or not the user has access to page2 while your building page1.
That way you can have the link call a javascript function that puts up
or alert, or not show the link at all.

Hope this helps,

Jerry

-----Original Message-----
From: msavoy@h... [mailto:msavoy@h...]
Sent: Friday, April 12, 2002 9:32 AM
To: ASP Web HowTo
Subject: [asp_web_howto] PLEASE HELP - Question on passing values to
another page & launching popup box


There is a DLL created by one of my colleages that checks to see if a
logged in user has permissions to access to any ASP page within our
application.  Currently the process is that when a logged in user is for

example on page 1 and clicks a link to get to page 2, page 2 contains
code that utilizes this DLL to checks to see if this user has
permissions
to access this page.  If the user does not have permissions to access
page 2 then the user is redirected to another ASP page that lists what
pages they do and do not have access to.  The code is as follows:

If Not objUser.HasAccess Then Response.Redirect "/show_access.asp?u=3D" 
&
strU

My task is to that when the user does not have permissions to access
page
2 then keep the user on page 1 but display a pop-up box that states they

do not permissions to access this feature.  The user can then close the
box and make another selection from page 1.

My problem is knowing how to code this.  I know I will be utilizing
Javascript, I am assuming on page 1.  ANY HELP would be APPRECIATED.

Thanks. 

---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20


---

Improve your web design skills with these new books from Glasshaus.

Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20

  Return to Index