Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 16th, 2004, 06:31 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default Refresh Screen

when i refresh the screen, it takes me to the login screen. How can I reload the same page with updated data without going back to the login page?

 
Old December 17th, 2004, 12:47 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

After login are u setting some variables as an indicator that user has logged in?


Om Prakash
 
Old December 17th, 2004, 02:30 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am storing user name and permissions in the session variables. Can that cause problem? If yes, then what is the alternative way to do it.

Thanks

 
Old December 20th, 2004, 12:05 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Renu,

Can you explain your problem and how your application is set up in a little more detail? Simply refreshing the page shouldn't cause your to be logged out unless you don't have the application set up.
 
Old December 20th, 2004, 12:26 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have a login page, where user logs in and I store the username and the access permissions (like access to update/delete the records later) in session variables. I use these session variables to decide what all controls/buttons to make visible. Then on any page if i hit the refresh screen, I am brought back to the login page. So, i have to log in again to get in. I have not set anything in my application to show the first page if refresh is hit. In fact i don't even know how to do that.
Please let me know what I need to do, so that it stays on the same page.
thanks a lot!

 
Old December 21st, 2004, 01:53 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Coiuld it be a problem because I am using frames?

 
Old December 21st, 2004, 04:50 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Very much so. When you hit refresh, you are refreshing the page in the outermost window of the browser, and thus, the page that contains the frameset. Presumably, your frameset contains the login page in the frame where you are expecting to see the page you were just on before refresh. You can refresh the page inside the frame by right-clicking inside the frame, then choosing "Refresh".
 
Old December 21st, 2004, 11:57 PM
Authorized User
 
Join Date: Aug 2004
Posts: 86
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ya! That worked! But, it won't be nice to ask users to right click and select refresh. Is there a work around this problem. It is hard for me now to change the frames. What else can be done. May be add a refresh button on the screen...I don't even like that. I tried adding meta tag to refresh the screen every 5 seconds, but it flickers. And after adding smartnavigation="true" (as I have a large form) for page, it stops automatically refreshing it. If it can refresh after every 5 seconds itself with (smartnavigation="true"), then my problem is solved. Is it possible?

 
Old December 28th, 2004, 03:50 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The prolem is that smart navigation is really only useful for a postback. You could simulate the meta refresh functionality and incorporate smart navigation by putting some javascript on the page that automatically calls some postback method based on a time interval. Try this out:

<script language="javascript">
setTimeout("<%=Page.GetPostbackEventReference(Me) %>", 5000);
</script>

This creates a simple call to the setTimeout method with a postback reference for the page and a timeout of 5 seconds. This causes a standard postback to happen automatically every 5 seconds. The relevant HTML for the rendered output of the page looks like this:

<script language="javascript">
setTimeout("__doPostBack('','')", 5000);
</script>





Similar Threads
Thread Thread Starter Forum Replies Last Post
how can clear the screen the screen malli_kv2 BOOK: Beginning Java 2, JDK 5 Edition 4 January 17th, 2009 12:43 AM
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
Draw on the screen without clearing the screen pu132 Visual Basic 2005 Basics 0 August 25th, 2006 09:03 PM
lock the screen darthziv Pro VB.NET 2002/2003 0 December 4th, 2005 03:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.