.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
satyapriyanayak
SP
abhays
Sasi Prabhu
Post New Web Links

After Login , Redirect To Previous Page Instead Of Destination URL set

Posted By:      Posted Date: October 01, 2010    Points: 0   Category :ASP.Net
 

Hi .

I have developed an asp.net project with asp.net membership for login.

I have login control in a page and for that I have set the property destination URL to a particular page say defaultlogin.aspx.

It is also working fine, when I use to login from home page.

But if i navigate to different pages of my website say first to home page, contact us page, about us page etc. Then after that when I click on login page and key up the login information in the login control.

I use to redirect to the last page which I have visited the last. It is not redirecting to the destination page which I have set in the login control.

What's the problem here?

Plz help me with the above issue.

Thanx in advance.




View Complete Post


More Related Resource Links

After login redirect to a desired page

  
Hi,   Just a simple question. After I click login button, I want to page be redirected to display.aspx. How to set up it? Sorry for the silly question.

Authentication required, redirect to login page

  
Hi,I want authentication required for all webpages in a site. If i copy the url of any of the web page in the current site and paste it in the url address i should redirect to login page. If you have any solution please suggest it.

how to redirect user to login page if session is null

  
i have 2 page,1.login.aspx ---  2.welcome.aspxin my login.aspx im storing username into sesssion as below:Session["usernm"] = txtUsername.Text;in my welcome.aspx  pagein page_load event if (Session["usernm"]==null)        {            Response.Redirect("Login.aspx");        }----- here if i manulally paste the url ( http://localhost:4125/Loginado/welcome.aspx) it should go to  login.aspx for user credentialsbut its going directly to welcome.aspx  page.

Redirect to Login Page from Generic Handler

  
Hi,I have created a asp.net generic handler to use it in auto-complete text box. Here is my code to it /// <summary>     /// Summary description for $codebehindclassname$     /// </summary>     [WebService(Namespace = "http://tempuri.org/")]     [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]     public class ProductSearch : IHttpHandler, IReadOnlySessionState     {         public void ProcessRequest(HttpContext context)         {             String query = context.Request.QueryString["q"];             if (! string.IsNullOrEmpty(query))             {                 int sid =  Convert.ToInt32(HttpContext.Current.Session["ScenarioID"]);                 int evId =  Convert.ToInt32(HttpContext.Current.Session["EventID"]);                 var products = from p in Data.BO.Product.GetScenarioProducts(sid, evId, query) select new { id = p.ID, name = p.Name };                &nbs

Session time out alert box and redirect login page

  

Dear all,

Now I am using Form authentication for my website. 

It is something like that below. But if I left the website without using it for quite some time and when I used it back, it is redirected to the login page. 

The one I want to know is that it is because of session expire or cookies expire. And if it is session expired, I want to show the alert box and redirect to the login page. And one more thing is that if the user keeps on using the website, I want to extend the session expire time. If you do not mind, I want to have some references for this scenario. Thank you so much.

Aung

If myUser.IsValidUser(txtUserName.Text.Trim, txtPassword.Text.Trim) = True Then

FileUpload redirect to login page

  

FileUpload works OK on my local site. When I moved my web application to a web host server, I tested to upload a file with this application, It's OK to upload file to the server before login. But after login, the FileUpload kept redirecting to login page without uploading. Any help? Thanks!


how to redirect from login page?

  

Hello,

I have three master pages in my projects. I would like to allocate each master page to each role(Admin, ValidUsers, nativeUsers). how can i do it plz any one explain me.


Redirect user to login page and back

  

How would I go about to solve this:

When the user clicks a button and the user has been inactive for too long (session is gone), then redirect the user to the login page and back to the current page after logging in?

Is there a built in solution to this or do I have to do it manually? If so, how?

Thanks!

/zalk


how to redirect to particular page after login?

  

hi,

any body knows how to redirect to particular page in the url after login in C# ?

Example

1) the home page is www.google.com/login.aspx it is login protected

2) in this application i have another page(post.aspx)  www.google.com/post.aspx?a=25&b=35;

the user try to enter the 2nd line of the link,  if the session is not valid it will automatically redirect to the first link, after enter the login id and pwd it should go directly to to the 2nd line of the link how?

expect the answer from masters.........

 

 


How to redirect my page to login page on Logout ?

  

Hi, 

In logout link's click event i have written Session.Abandon() that will destroy the Session state.I am also handling Session_End event that is fired afterward (written in Global.asax). But one more thing i want is that after Session ends, login page should be redirected (opened).

For that i wrote:

 Protected Sub logOut_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles logOut.Click
        Session.Abandon()
        Response.Redirect(PostLogoutRedirectedPage.HomeUrl)

End Sub


This is working fine on the surface, but after applying debugging i saw that there were unexpected number of  calls to Session_Start and Session_End events for two times, then login page was opened.

Why Session_Start and Session_End was called two times ? If i left this process as it is working then may i get some serious error in future ?


Auto logout and redirect to login page when session expires using asp.net

  
In this article I will explain you how to auto logout and redirect to login page when users session expires within specific period.

Retrieving a variable from a previous page

  

Hi,

I'm looking to have a search page where a user will select an item from a listview, then then taken to another page that wil display data based on their original selection.

A user will type in a string and be presented with a list of usernames that are like that string, when they select a user name who's profile they would like to view I would like the page that they're taken to, to be that users profile.

How would I transfer the variable from the search page to the profile page, and when I work on the profile page, how can I access that variable?


Thanks.


Redirect to a mobile page

  
Hi please can anyone help? I have a simple website with a home page called defaut.aspx, also I have a page with in this site called mobile.aspx. My question is, bearing in mind that I posses very little knowledge of VB, what code do I need to place in the default.aspx to detect what kind of device someone is using and redirect them to the mobile page (mobile.aspx)? This needs to be quite up-to-date preferably for blackberry and nokia devices?

Thanks


Detecting PPC device on startup page to redirect?

  
I was wondering (since a search didn't find any posts) if there is a way for my startup page to detect what kind of device (PocketPC or web browser specifically) is loading the page and if it is a PocketPC, then redirect to the mobile pages? I will only be using PocketPC's exclusively as a mobile device.

Thanks for any suggestions!
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend