CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 Conditional redirect based on userRights

Print topic Send  topic

Author Message
istankovic
Posted: 10/30/2003, 6:30 AM

I can't find any sample showing how to redirect user on login to a given
page based on his security level. Can someone drop me a code snippet in
VB.net for that?

Thanks in advance

DonB
Posted: 11/03/2003, 12:51 PM

I think you must be referring to CCS although this is the CC forum.

There is a variable, "redirect", that holds the page (URL) to which the user
will go next. Add a column to the table holding your group IDs (or create a
table if you didn't do it that way). Then you only have to do a lookup on
the group table to get the URL or page that you need to store in the
redirect variable (do this after they get logged in, of course). CCS will
take care of the rest for you. You might have to try doing this in either
the Before Page Unload or the Click event on the "login" button to suit your
particular needs.

Sorry, I have no code snippet handy.

If you need to see the syntax for doing this, hard-code something into the
"Return Page" property of your login button, then look at the code CCS
creates to implement that. Use this as your guide for writing your own code
(and be sure to remove the hard-coded value so it doesn't override what you
implement).

--
DonB

http://www.gotodon.com/ccbth


"istankovic" <istankovic@hotmail.com> wrote in message
news:bnr7ap$3o6$1@news.codecharge.com...
> I can't find any sample showing how to redirect user on login to a given
> page based on his security level. Can someone drop me a code snippet in
> VB.net for that?
>
> Thanks in advance
>
>

istankovic
Posted: 11/04/2003, 3:01 AM

I have the solution
In case others need it:

Add Custom Code action for the login button server side onClick event that
would be executed after Login action. Here is sample code for redirecting
user to different pages:
If DBUtility.UserGroup = "2" Then
RedirectUrl = "AdminPage.aspx"
If DBUtility.UserGroup = "1" Then
RedirectUrl = "UserPage.aspx"


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.