Click to See Complete Forum and Search --> : Page redirection problem in vb.net


rskshiva
03-30-2006, 06:11 AM
I have an aspx page have 3 frames. Top(for Banner), left(for Menu) and Middle frame (for aspx pages). I have to redirect the page to LOGIN screen if the URLREFERRER not exists.

I have included the following code in the aspx pages (getting displayed inside the middle frame)

If strUrlReferrer Is Nothing Then
HttpContext.Current.Response.Redirect("Login.aspx")
End If

It is working but what happens is Login screen is getting displayed in inner frame (i.e middle frame) and Menu items(Left frame) and Top Banner (Top frame) are also visible.

My requirement is: Login page should come in the main window and not inside any frame. Kindly suggest as it is very urgent.

Thanks in advance.
Siva

sirpelidor
03-30-2006, 12:38 PM
There's quite a few ways to go around it. as for starter, i take that u are traditional asp developer? Maybe its about time to stop using frames?

the 2 methods off the top of my head...
solution 1) don't use frames

make 3 web user control (ascx files), header.ascx, menu.ascx, and footer acsx, and embedded your user controls into aspx pages. that way, Response.Redirect("login.aspx") will get you there without worry about frames.

solution 2) sticking with frames [are you sure about that?]
use the following html code:

<a href='login.aspx' TARGET="_top">Login</a>


hope that helps

rskshiva
03-30-2006, 11:05 PM
Thanks for your reply. But we are not using "a href" tag to redirect the page . Page redirection script is written in a script file and included in all aspx files. I had included the redirection script also for your ref.

If anybody types the URL directly in the browser, it should redirect the user to login screen. This is the objective.

Looking forward for your suggestions.

Thanx.
Siva

handshakeit
03-31-2006, 01:36 AM
for this you r to implement web security to your application in your webconfig file

sirpelidor
03-31-2006, 02:09 PM
if you want to implement security, Web.config is your friend.

take a look at this website:

http://www.dotnetcoders.com/web/Articles/ShowArticle.aspx?article=186


all the contents which needed to authenicated will be within the sub folder, and root folder only shows public aviable contents.

See if that helps