Anonymous Users Not Working on Load of page From login page

 In a button click i  transfer the user to form1 where  HttpContext.Current.User.Identity.Name.ToString does not have a value on this page until a postback occurs, how do i simulate a postback in code behind?


0
dan_2009
4/29/2009 8:52:58 PM
asp.net.security 27051 articles. 1 followers. Follow

1 Replies
1172 Views

Similar Articles

[PageSpeed] 1

Hi,

Are you using  Server.Transfer("url");? Method Transfer() will not bring user's credential while redirect page(do not have cookie).

Instead,you can use Response.Redirect("url");

Regards

   


Andrew Zhu
Microsoft online ASP.NET support
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
0
Andrew
5/5/2009 6:08:50 AM
Reply:

Similar Artilces:

Routing unauthenticated users to login page, then onto the intended secure page after login
Ok, in my setup, I made a folder called "Secure" and in the ASP.NET web administration tool via VWD, I added an access rule that denies anonymous users access to aspx files in that folder.  Now, when I directly type in a URL pointing to an aspx file in the "Secure" folder when I'm unauthenticated, the system knows to route me to the login page (I'm using the default membership provider in VWD), and after successful login, to the secure page that was the intended destination.  So I thought all was good.  For reference, here's how it looks li...

Paging Paging Paging
I am trying to do paging with my search results and it isnt working very well. Here is what I've tried and I feel I've tried everything, lol, please help me out. Sub DataGrid1_SortCommand(Sender as object, e as DataGridSortCOmmandEventArgs) DataGrid1.DataBind() End Sub Sub Datagrid1_PageIndexChanged(Sender as object, e as DataGridPageChangedEventArgs) Dim ds as dataSet DataGrid1.CurrentPageIndex = e.NewPageIndex if Session("Search") is nothing then 'Session probably has expired, get the datasource from database Datagrid1.DataSource = ...

Secure page to Secure page
Name: Jonathan Email: jbeldonatopenwaterloansdotcom Product: Firefox Release Candidate Summary: Secure page to Secure page Comments: I have had several crashes going from a secure page to another secure page. The response I often get is that the page does not exist. This only seems to occur on secure pages. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b4) Gecko/2008030714 Firefox/3.0b4 From URL: http://hendrix.mozilla.org/ ...

i had a aspx pages while user is moving from one page to anoter he has to send to login page
 Hi every one i had some aspx pages, where user can see some pages with out login ,but when he click some pages like admin page he has to take to log page and then after he has to redirected to the same page  from where is redirected fromurgent plz  srinu. You might want to use Membership to register the users who are allowed to see the admin pages.http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx Then you can use Roles to restrict the accessibility to certain folders to certain user groups.http://quickstarts.asp.net/QuickStartv20/aspnet/doc/security/membership.asp...

Need help related to redirecting to login page if unauthorised user try to view secure page
Hello AllI am facing a problem when an unauthorized user tries to access a secure page. Usually the unauthorized user is redirected to the login page without any note or any information given to them saying that " YOU ARE UNAUTHORIZED TO VIEW THIS PAGE ". Can anyone help me as my requirement is to  either display a message or redirect them to an error page first and then depending on the users choice, user will click on given link to continue the older session of  browsing or login to different role which is having access to view Secure page. Store userid / username i...

page prerender and page init, page load
 what is the sequence of these event handlerspage prerenderpage initpage loadCould some one tell me what to do in each event handlers. if i want to load controls dynamically is it page -load i need to use. if i do a post back then do all the events rise again. is it going to be the whole page life cycle.if it is then i dont want to load controls everytime as it costs load time you can find an FAQ on the event sequence here: http://forums.asp.net/t/1191194.aspx on a postback, the pages full life-cycle is repeated.Mike Banavige~~~~~~~~~~~~Need a site code sample in a different language? Try converting it with: http://converter.telerik.com/...

Web page .aspx is slow when loading. Pages have web user controls on them that are loaded dynamically
I have written a web application using VS 2003. Several of my forms have web user controls on them. The controls are loaded dynamically at runtime. The problem is that the web pages are very slow to load. Does anyone know if there is a way to speed up the pages being loaded into the browser? Here is an example of some code I use to dynamically load the controls:  private void Page_Load(object sender, System.EventArgs e)  {   // Put user code to initialize the page here   // Put user code to initialize the page here    Control marketWebUserControl = Page.LoadControl("Market.ascx");   // Typecast the user control to the strong name   // And set its properties    //((Market)c).BackColor = Color.Beige;      MarketSubMarketPh.Controls.Add(marketWebUserControl);  }  Honestly it all depends what your controls are page is doing.... Some general hints is to remove viewstate if possible and second check the size of the page that's being created in html.... By viewing the source and saving that text file, you could be amazed at the size...  Another idea would be to trace your page and see what's killing the load time.. To do this simply add Trace=True in your <@ Page declarative. on the aspx page.   Oh one more thing.... Instead of dynamically adding your controls if it's not necessary i would suggest jus...

Different Login Pages for different secured pages.
Hi, I'm using Forms authentication. On the admin pages, I want an unauthorised user to be sent straight to the login.aspx, but on 1 page (not within the admin section) I'm using the <location path="~/ImageView.aspx"> element and I want an unauthorised user to be sent to the "~/mustlogin.aspx" as this will display further information to the user. Is there a way to do it???   Multiple config files, all named Web.config, can appear in multiple directories. Each Web.config file applies settings to it's own directory and all children directories...

Anonymous Access to some pages, Secure access to other pages
I have an application that I want to allow anonymous access to some of the pages and enforce page level authorization on others. How do I go about setting up the authorization settings in Webconfig? I'm using forms authenitcation with the RedirectFromLoginPage method. Try this for the web.config <configuration> <system.web> <authentication mode="Forms"> </authentication> <authorization> <allow users="*" /> </authorization> </system.we...

javascript working on page load but not on page refresh.
Hi This web page consits of a drop down list, a label to fil (its an innerHTML caption) and two radio buttons which fill the drop down list with Active and inactive Clients. On page load or refesh the caption is filled with the selected item in the drop down list using javascript on the initial page load after a startup or a redirect. It shows the text value of a drop down list selected item in a caption on inner HTML But I am having problems with the javascript portion of the code. Before the script worked fine and with the following bit of code which works when called with a set ...

page after the login page
i want the user to be redirected to a page called "account.aspx" for example and not "default.aspx" when he/she successfully login . how this can be done . thanxComputer Engineer, CIW , MCP , MCSAhttp://www.elmajdal.net FormsAuthentication.SetAuthCookie ("username", false) Response.Redirect("account.aspx") HTH Sushila Bowalekar PatelVisual ASP/ASP.NET MVPhttp://weblogs.asp.net/sushilasb yah k k it worked , i thought we needed something else . thanx manComputer Engineer, CIW , MCP , MCSAhttp://www.elmajdal.net...

Page-Up/Down Not Working on Some Pages
There are certain web sites in which PG Up/Down doesn't work, and I have to use the mouse and scroll bar. Unfortunately, the one I am looking at right now needs a password, so it would be useless to send you the link. HAs anyone else noticed this, and found a solution for it? Buck Turgidson wrote: > There are certain web sites in which PG Up/Down doesn't work, and I have > to use the mouse and scroll bar. Unfortunately, the one I am looking at > right now needs a password, so it would be useless to send you the link. Take the HTML-code and make your own page...

load page in frame on page load
Hello is it possible on an event PageLoad to load a page in a frame. I tried many things but it stil coms to that i have to use a butten instead   tnx   Sure, we did this a while back. When you setup your frame give the one that you need to change out a name. In ours it was id='BottomContent'. Then on the Page_Load or any other event that you may need use the code below.(Just replace .BottomContent with the name that you gave to your frame) Response.Write("<script type='text/javascript'>parent.BottomContent.location='www.theurlyouwanttoload.com';</script>");It'...

Page Load loading on wrong Page
Hey there, I've been working with ASP.net for a few months now and notice some strange behaviors when it comes to Page_Load, postbacks etc. I normally find some fix for what I can't really explain what is happening, but today I'm not so lucky. I understand the Page_Load event is called when a page is loaded or the form posts back to itself. However, I notice that sometimes the Page_Load event is called at other strange times. For example.... I have the following data lists on a page called add-catalog.aspx... <asp:datalist id="_catalogs" Runat="server" ...

Custom error page not working properly at the login page
Hi,I am building a website that is secured by Forms authentication. Also I have setup a custom error page using the CustomErrors tag in the web.config file.When an error occurs on a ordinary webform (for example default.aspx) the user is correctly redirect to my custom error page.But when an error occurs at the login page something very strange happens, it seems like ASP.NET tries to redirect to my login page, as well to my custom error page. An example of the URL is: http://localhost:1078/Protect/Login.aspx?ReturnUrl=%2fprotect%2fErrorPage.aspx%3faspxerrorpath%3d%2fProtect%2fLogin.aspx&...

Updatepanel
Hi, I have few tabs in my page, when user changes the tab, I am loading page contents Async'ly. I want to make all tabs are inaccessible to user during load time. How can I ? Thank you.  Regards, Sreedhar You can tap into the events of the PageRequestManager. It fires init, begin, and end request events when an async update occurs.  Sys.Application.add_init(Page_Init); var prm = Sys.WebForms.PageRequestManager.getInstance(); function Page_Init(sender) { prm.add_initializeRequest(Page_InitRequest); prm.add_beginRequest(Page_BeginRequest); prm.add_endRequest(...

Pages dont work, firefox trys to load the page
Name: Domi Email: dweberdotrowatwebdotde Product: Firefox Release Candidate Summary: Pages dont work, firefox trys to load the page Comments: Since today I can't open a direct link on pages, firefox just trys to load it, but it seems to me, that it always trys to refresh it instead of just loading it. This only appears when I open it normally, by opening pages in a new tab it works well. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9) Gecko/2008051206 Firefox/3.0 From URL: http://hendrix.mozilla.org/ ...

Why does login page not take the user to destination page specified
Hi, When a user logs into my system, they are not being taken to the page specified as the destination page on successful login. I was wondering whether I put some code like this into the page load of the code behind, whether it would take the user to the homepage instead of the last page that a user had visited.if (user.identity.isauthenticated == true) {Response.Redirect("~/Secure/homepage2.aspx"); } Thanks, Hayley Hi Hayley,This video should help http://www.asp.net/learn/videos/video-06.aspx ...

Login page unable to load
Name: Andy Email: wizard_183athotmaildotcom Product: Firefox Summary: Login page unable to load - directed to error page Comments: www.paws.usask.ca Login page unable to load at all, then redirected to timed-out error page. Error page attempts to reload login page again, but no luck. Browser Details: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090616 Firefox/3.5 (.NET CLR 3.5.30729) From URL: http://hendrix.mozilla.org/ Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not C...

Prevent users load to pages except home page
I want to prevent users to load pages direct freom browser, except the home page One way is write code to control the Session in JSP... if the Session is not valid then do eg forward to another page The qustion is can EAS manage the above situation and how ? or does anyone knows a different solution ? Thanks, Soteris You can setup J2EE security to secure pages and only allow access to given users with given roles. The J2EE security will force users to login before they can access a given resource. -- Dean Jones [TeamSybase] CEO PowerObjects http://www.powerobjects.co...

Page.User.IsInRole only working to check AD in vs.net, does not work once site is published.
 RE: Page.User.IsInRole only working to check AD in vs.net, does not work once site is published.  I checked local IIS and site is configured to annonymous and Integrated Windows Security. This is Odd. I have an an AD group on my domain. I am able to restrict diretory access via the web config allow roles pointing to it. works great everywhere I deploy. And in my master page codebehind, I can test isinrole while in VS and works great. This statement being false.  If Not (Page.User.IsInRole("mydomain\myADgroup")) Then However if I publish the site to my l...

Redirecting from login page to different pages based on user roles
Hi,I have this requirement where the user on successful login has to be redirected to different pages based on the user role. For example: I have 3 pages - Sales,Recruiting and HR . When a user in the recruiter role logs in, he/she should be redirected to the recruiting page. How can I achieve this with DNN. Any suggestion/help is appreciated.Thanks,Trisha <qoute>Hi,I have this requirement where the user on successful login has to be redirected to different pages based on the user role. For example: I have 3 pages - Sales,Recruiting and HR . When a user in the recruiter role logs in,...

How to show deafult page in a fckeditor on page load in VB.Net
HiI want to show default page in fckeditor on page load but but I am not able to this.This is my code which is depict below :-Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load        FckEditor1.InitalizeEditor()       dispalayHtml() End Sub  Private Sub dispalayHtml()        Dim shwHtmlcontect As String         shwHtmlcontect = "C:\Documents and Settings\Kaleem\Desktop\Test.html" &n...

Page To Page
Hi How can i call to a Text that has been written in a different page(in a TextBox). I want to call him to make a SELECT quastion. Thank's....

Web resources about - Anonymous Users Not Working on Load of page From login page - asp.net.security

Anonymous blogging - Wikipedia, the free encyclopedia
Anonymous blogging is the creation and maintenance of an online blog while maintaining the author's anonymity . Unlike fake blogs , anonymous ...

REPORT: Facebook to Launch Anonymous App
While Facebook has stuck with its policy of requiring its users’ real names , co-founder and CEO Mark Zuckerberg mentioned in a January cover ...

Anonymous hat Occupy Mainstream Medias Foto geteilt. - Facebook
Tritt Facebook bei, um dich mit Anonymous und anderen Nutzern, die du vielleicht kennst, zu vernetzen.

Anonymous Login
The most convenient way for people to log into your app without sharing their personal information.

STUDY: Facebook bouncing back in social logins, with help from anonymous login
... and retail sites. Jamie Beckland, Janrain’s VP of Marketing & Customer Success, told Inside Facebook: Facebook’s recent announcement of Anonymous ...

Anonymous Operations (@YourAnonCentral) on Twitter
Sign in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Anonymous Operations @ YourAnonCentral ...

Zuckerberg condemns Facebook staffers for anonymous tags at work
... to be the case. As a result, co-founder Mark Zuckerberg reportedly posted a private company-wide memo condemning a particular wave of anonymous ...

How Anonymous helps the homeless survive winter
Hacker collective Anonymous mostly gets press for its big campaigns, including fighting Islamic State, and tackling pedophiles and Scientologists, ...

Anonymous Oscars 2016 voter reveals what he really thinks of top nominees
If you're in the movie industry in any capacity, whether you're a director, actor, special effects guru, or even a sound engineer, the biggest ...

Anonymous BrooklynVegan Comments, Rest in Peace
Love them or hate them, anonymous comments were a trademark feature of BrooklynVegan's unchanged design for over 12 years. And it wasn't all ...

Resources last updated: 3/8/2016 3:54:15 PM