473,785 Members | 2,910 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

back in history on aspx page

Hi,
I have a login page and after click on button Login I check username and
password and if it is correct, i want load page, which was there before
Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos
Nov 16 '05 #1
7 10228
How do you go to the login page? I mean... if I land of secretpage.aspx , how
do you validate the login?

Are you using web.config configuration or FormsAuthentica tion on each secret
page?

--

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
-----------------------------------
"Luboš Šlapák" <lu**********@c entrum.cz> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,
I have a login page and after click on button Login I check username and
password and if it is correct, i want load page, which was there before
Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos

Nov 16 '05 #2
I don't use web.config, because i don't know how to use it, i have
Login.aspx and when i go to secret page, it is redirect to Login page, where
i validate login information from database. So I need after login redirect
back on secret page.
"Gaurav Vaish" <mD************ *************** **@nospam.lycos .com> píše v
diskusním příspěvku news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
How do you go to the login page? I mean... if I land of secretpage.aspx , how do you validate the login?

Are you using web.config configuration or FormsAuthentica tion on each secret page?

--

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
-----------------------------------
"Luboš Šlapák" <lu**********@c entrum.cz> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,
I have a login page and after click on button Login I check username and
password and if it is correct, i want load page, which was there before
Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos


Nov 16 '05 #3
How does secret page know whether you are logged in or not is what I want to
know...

Ok.. you can do the following:

1. Login.aspx
-> When you jump of the login page, do a:

// First time a user is redirected to the page
if(!IsPostBack)
ViewState["referer"] = Request.ServerV ariables["HTTP_REFER ER"];
else
// If user is validated, redirect him back.
if(ValidateUser (username, password))
Response.Redire ct((string)View State["referer"]);
--

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
-----------------------------------
"Luboš Šlapák" <lu**********@c entrum.cz> wrote in message
news:e4******** ******@TK2MSFTN GP09.phx.gbl...
I don't use web.config, because i don't know how to use it, i have
Login.aspx and when i go to secret page, it is redirect to Login page, where i validate login information from database. So I need after login redirect
back on secret page.
"Gaurav Vaish" <mD************ *************** **@nospam.lycos .com> píše v
diskusním příspěvku news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
How do you go to the login page? I mean... if I land of secretpage.aspx ,

how
do you validate the login?

Are you using web.config configuration or FormsAuthentica tion on each

secret
page?

--

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
-----------------------------------
"Luboš Šlapák" <lu**********@c entrum.cz> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,
I have a login page and after click on button Login I check username and password and if it is correct, i want load page, which was there before Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos



Nov 16 '05 #4
Hi,
It could be as easy as sending the referer page as a parameter:
you go to secretpage.aspx in the page_load do a check to see if the user is
logged, if not do a redirect to login.aspx?gone xt=secretpage.a spx

in this way to know where to go after a succesful logon, you just do a
redirect pointed with the parameter.

cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Luboš Šlapák" <lu**********@c entrum.cz> wrote in message
news:%2******** ********@TK2MSF TNGP11.phx.gbl. ..
Hi,
I have a login page and after click on button Login I check username and
password and if it is correct, i want load page, which was there before
Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos

Nov 16 '05 #5
If you are using ASP.NET forms authentication, the safest way to
redirect is with FormsAuthentica tion.RedirectFr omLoginPage.

--
Scott
http://www.OdeToCode.com

On Thu, 16 Sep 2004 11:47:42 +0200, "Luboš Šlapák"
<lu**********@c entrum.cz> wrote:
Hi,
I have a login page and after click on button Login I check username and
password and if it is correct, i want load page, which was there before
Login page. How can I do it? In javascript it is simply

<script language="javas cript">window.h istory.back();</script>

but How can I do it in C# code?

Please help. Thanks Lubos


Nov 16 '05 #6
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:cc******** *************** *********@4ax.c om...
If you are using ASP.NET forms authentication, the safest way to
redirect is with FormsAuthentica tion.RedirectFr omLoginPage.


That will require web.config modification... loginUrl= etc.

Lubos mentioned that he's not using web.config. Otherwise that's the
cleanest bet.
--

Happy Hacking,
Gaurav Vaish
http://www.mastergaurav.org
-----------------------------------
Nov 16 '05 #7
I think it would be easier for him to learn how to use web.config then
reimplement forms based authentication with his own code.

--
Scott
http://www.OdeToCode.com
On Thu, 16 Sep 2004 18:36:20 +0530, "Gaurav Vaish"
<mD************ *************** **@nospam.lycos .com> wrote:
"Scott Allen" <bitmask@[nospam].fred.net> wrote in message
news:cc******* *************** **********@4ax. com...
If you are using ASP.NET forms authentication, the safest way to
redirect is with FormsAuthentica tion.RedirectFr omLoginPage.


That will require web.config modification... loginUrl= etc.

Lubos mentioned that he's not using web.config. Otherwise that's the
cleanest bet.


Nov 16 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
8911
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
2
11082
by: Luboš Šlapák | last post by:
Hi, I need (in one function in aspx page) return the WWW browser back to previous page. How can I do it? Thanks
2
3844
by: Frawls | last post by:
Hi Can any one give me some help with this problem please? Here is the scenario: A user submits page 1 which is a web form.
3
4148
by: Michelle A. | last post by:
What is the difference between the two? I have a page "one" with a button using Response.Redirect("pagetwo.asxp") to go to the next page. On page two I have a button using Response.Redirect("pageone.aspx") to go back to page one. When I view page one, select some information, then go to page two, and then select the back button (using the response.redirect) none of my selections
4
3259
by: Bratislav Jevtic | last post by:
hi, ASP.NET, framework 1.0, patch 2, Windows 2000 server is this possible: from server side to say "go back" to browser? ------------------- scenario: I've got some page with a list. When one clicks some button goes to "detail" page - for to add/update data. That form may have number of postbacks. On
8
2177
by: moondaddy | last post by:
Is there a way to make the browser move back to the previous page via code behind on the server? The effect would be the same as the user clicking on the browser's back button. Thanks. -- moondaddy@nospam.com
2
2434
by: ShaneFowlkes | last post by:
I created a couple of quick test pages and to my surprise, these do not work either. When I click "Go Back" on test2.aspx, nothing happens. Ideas?? Surely I must be missing something obvious..... Thanks PAGE 1 - test.aspx <%@ Page Language="VB" %>
3
1432
dotneto
by: dotneto | last post by:
Hi, There is a strange behaviour with ie7 and browsing history. In a page (aspx), the user can download a file. If he navigates back from that page, the page is lost(from browsing history), an sometimes it navigates to another page, the previous, is there is one. I mean,you were in page 2 an navigate to page 3, download the file and everything and click the back button, you were supposed to be taken to page 2 again, but no, the page 2 was...
12
8868
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell me how to do this? I thought perhaps there would be some kind of special meta tag that says something like "exclude me from browser's history", but have been
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10151
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3647
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.