FormsAuthentication.RedirectFromLoginPage - Fragment Not Preserved On Redirect?

Mar 3, 2010

I have a page, URI looks like this:

http://domain.example.com/Profiles/Profile.aspx?username=blah#blahtab

When that fragment (#blahtab) is present, some jQuery picks up on that and displays a different section of the page initially. However, that page requires a user to authenticate first. Coming back from the authentication step using FormsAuthentication, the fragment is discarded, regardless of the UrlEncode step.

I don't see the fragment actually sent to the server when I use a debugger on my local machine. Is this standard fare and the fragment is only for the client side?How can I keep that tacked on without writing my own redirection code on the login page?

Alternately, should I use another method to preserve the view of the page?

View 1 Replies


Similar Messages:

Using The FormsAuthentication.RedirectFromLoginPage For The User Login And For Redirect To Default

May 24, 2010

i'm using the FormsAuthentication.RedirectFromLoginPage for the user login and for redirect to default.aspx page. I want that if a user called admin do the login is redirected to the page admin.aspx

View 3 Replies

Security :: What Is The Difference FormsAuthentication.RedirectFromLoginPage And FormsAuthentication.SetAuthCookie

Mar 16, 2010

What is the difference between:

FormsAuthentication.RedirectFromLoginPage

AND

FormsAuthentication.SetAuthCookie(Text_txtUserName.Text, true);
HttpContext.Current.Response.Redirect(RedirectFromLoginAddress);

View 3 Replies

Security :: FormsAuthentication.RedirectFromLoginPage In IE8

May 5, 2010

I have the following code in my secure/login.aspx page using .NET 3.5 and VB.NET

[Code]....
[Code]....

I read some articles that mentioned specifying the domain attribute within the <forms tag but that did not seem to work either. e.g.

View 4 Replies

FormsAuthentication.RedirectFromLoginPage Does Not Return To Orignal URL?

Jan 5, 2010

I reach my login page with the parameter "returnUrl" set to the URL I was on. Then, I login via OpenID (DotNetOpenAuth), and call FormsAuthentication.RedirectFromLoginPage(). The login is successful, however I am not returned to the original page I was on.

I'm having the same problem on logout - when I log out I don't remain on the same page, even though the logout link contains the correct "returnUrl" parameter.

What am I doing wrong?

Here is the code snippet. I am returning EmptyResult() after the call to RedirectFromLoginPage, because I don't really know what to do (see this related question)

using (var relayingParty = new OpenIdRelyingParty())
{
var response = relayingParty.GetResponse();[code]....

View 1 Replies

Call FormsAuthentication.RedirectFromLoginPage 10'000 Times?

Dec 30, 2010

Is it OK to call FormsAuthentication.RedirectFromLoginPage many times?

On login page we test if user is already logged in, and if it is we just redirect him to default page with FormsAuthentication.RedirectFromLoginPage...

Question is if user sets a script that loads login page 10'000 times, would calling the FormsAuthentication.RedirectFromLoginPage that many times make problems?

View 2 Replies

C# - ASPX FormsAuthentication.RedirectFromLoginPage Function Is Not Working Anymore

Mar 23, 2010

I have an ASPX web site and I have code in there to redirect from the login page with the call to

"FormsAuthentication.RedirectFromLoginPage(username, false);" This sends the user from the root website folder to 'website/Admin/'. I have a 'default.aspx' page in 'website/Admin/' and the call to redirect works on a previous version of the website we have running currently, but the one that I am updating on a separate test server is not working. It gives me the error "Directory Listing Denied. This Virtual Directory does not allow contents to be listed." I have this in the config file:
<authorization>
<allow users="*" />
</authorization>

under the "authentication" option and...

<location path="Admin">
<system.web>
<authorization>[code]....

for the location of Admin.Also, there is no difference in the code between the web.config, Login.aspx, or the default.aspx files on the current server and the one on the test server, so I am confused as to why the redirect will not work on both. It even works in the Visual Studio server environment, for which the code is also identical.

View 1 Replies

Security :: FormsAuthentication RedirectFromLoginPage Change Default.aspx

Oct 14, 2010

I know this post is the same than other around but I can't get it to work the way I want, the thing is that the Login.aspx page have it in a folder not in the root of the directory, also the page that I want to redirect the user to is in the same folder, so far I got this in my web.config file

[Code]....

All pages contained in the Admin folder want it to be protected, the administrator needs to authenticate first, so my question is what I am doing wrong? need to take the Login.aspx and the admin.aspx out of the admin folder?

View 5 Replies

Security :: How To Set Request.IsAuthenticated To True When Not Using FormsAuthentication.RedirectFromLoginPage

Dec 19, 2010

How to set Request.IsAuthenticated to true when not using FormsAuthentication.RedirectFromLoginPage?

View 3 Replies

Security - FormsAuthentication - Unable To Redirect After Login?

Aug 9, 2010

I am using Forms Authentication in my VS-2005 website.In case of wrong credentials or while explicitly requesting protected pages the website is able to redirect user to login page. However, when correct login credentials are provided the application is not able to redirect the user to the desired page.While debugging I found that 'Request.IsAuthenticated=False' just before I redirect the user to the desired page.While coding I thought that this property will be set to true automatically after I generate the Authentication ticket. So do I need to set it explicitly inside the submit button click on Login page after validation?BTW I have not used the 'GetAuthcookie', 'SetAuthCookie' or 'RedirectFromLoginPage' methods.
I am posting the code inside the submit button click on the Login page as well as the Authentication and Authorization tags in web.config.

<authentication mode="Forms">
<forms name=".ASPXFORMSDEMO" loginUrl="~/Login.aspx" cookieless="UseCookies" path="~/"/>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

Protected Sub btnsubmit_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnsubmit.Click
'here first validate if the user is valid user
ad = New Aranya_Data

[code]....

View 1 Replies

.net - How To Set Request.IsAuthenticated To True When Not Using FormsAuthentication.Redirect

Jan 20, 2010

I am using Form Authentication and sending an Aajx request to the server for authentication. Based on the json result, the client decides where to go and what to do. That is the reason I am not using FormsAuthentication.RedirectFromLoginPage to not interfere the ajax/json response.In this case Request.IsAuthenticated returns false, even after validating the user with Membership.ValidateUser. Then I set the cookie using FormsAuthentication.SetAuthCookie(username, false)

View 2 Replies

Web Forms :: Changes To Pre-filled Textboxes Are Not Preserved?

Feb 6, 2011

I created a simple web form in which some default values are added to the textboxes on Page_Load. I added a button which when clicked, inserts the textbox values to a db. When executed, the default values are stored instead of the changes.

My guess is that when the button is pressed, the page is reloaded and the default values overwrite the user inputed values. Is there any way to prevent this re-fresh?

View 2 Replies

State Management :: Viewstate Preserved Despite Being Turned Off?

Jan 28, 2011

I am having trouble turning off viewstate for the controls in a page/form. Whatever I try the controls preserve & display the user input. I first turned viewstate off at control level, then page level and finally site level,yet still the form repopulates with values entered.

CONTROL

<asp:TextBox ID="TextBox1" runat="server" EnableViewState="False"></asp:TextBox>

PAGE

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="test.aspx.cs" Inherits="test" EnableViewState="False" %>

SITE

<pages enableViewState="false"/>

Inspite of all this the textbox, checkboxes, dropdowns etc preserve and display the user input on postback. Obviously I am doing something 'dumb' or laboring under a misconception. I'd like to know what!

Incidentally a gridview on the same page which displays all records from the table the form is used to fill can be disabled, ensuring it shows all records + the new one).

View 5 Replies

Forms Data Controls :: Dynamic GridView ViewState Not Preserved?

Apr 22, 2010

I am creating a gridview dynamically in a custom control and adding it to a Panel. I set the EnableViewState = true. The problem is that on a page postback the GridView does not seem to retain its values. If I add a GridView through the UI then the viewstate is preserved. The problem seems to occur when it is put dynamically only.

View 2 Replies

MVC :: Retun XML Fragment Back To Web Service Url

Jan 15, 2011

I need to return xml file back to web server url for credit card payment. can you guys have some sample how to return xml back to web service using MVC.

View 9 Replies

MVC :: Returning A Model And A Html Fragment?

Sep 29, 2010

I have a web page with a form in the footer, when the user clicks submit in this form I submit their data and then return the view with the model with the line

[Code]....

but this means that the user is at the top of the page and cannot immediately see the validation errors or success message on that page as this information is posted in the footer section so is there a way to return a view with the model and a html fragment so the url is http://website/page#footer so that they can see this straight away without having to scroll down.

Also I have to assume the user has javascript turned off and the user could be using browsers ie6 and greater.

View 10 Replies

IIS Throw Away URL Fragment On Custom Error Pages?

Nov 5, 2010

I'm using the old 404-rewrite method on a certain site that is tied to IIS6 *. So if I enter [URL] it calls my error page like so [URL]
Except if I call the page with a fragment, like [URL] I get the same result as above. I can't find the fragment anywhere:

Request.Url
Request.Url.OriginalString
Request.UrlReferrer
Request.RawUrl
headers, server variables, etc

This has come up because I want to resolve paths created by AJAX to their server-side versions. Is there any way for me to retrieve the original path from my handler?

View 1 Replies

WebMatrix :: Can't Get Inline IF Statement To Write A Fragment Of Text?

Mar 7, 2011

I'm trying to get a Razor conditional to write a few characters into an HTML page, but I can't figure out the syntax to pass the text characters straight to the screen. This bit of code works correctly:

@{if(sortColumn=="BbConvTerm"){<p>ASDF</p>}}

But I don't want those <p></p> tags. I just want it to insert the "ASDF" characters into HTML. For example:[doesn't work] @{if(sortColumn=="BbConvTerm"){ASDF}} [doesn't work] @{if(sortColumn=="BbConvTerm"){new HtmlString("ASDF")}} [doesn't work] @{if(sortColumn=="BbConvTerm"){Html.Raw("ASDF")}}

View 3 Replies

Web Forms :: Fragment Caching User Controls And Cache Invalidation?

Apr 8, 2010

In our .aspx pages we have user controls each control has a Sql query to fetch data. The caching mechanism to be followed says that fragment cache all the user controls and invalidate the cache based on the respective queries of the user control.How to proceed to add a query dependency to fragment cached user control?

View 1 Replies

Security :: Specify URL For RedirectFromLoginPage Method?

Mar 17, 2010

How can I do this?I want to be able to manually specify the location that I want the user to be redirected to using this method....?

FormsAuthentication.RedirectFromLoginPage

View 4 Replies

Security :: RedirectFromLoginPage For Multiple Sites?

May 12, 2010

I have created two iis web sites (site1,site2) both have the following configuration

[Code]....

from site1 i do

[Code]....

and in site2 if i checked if the user is authenticated ,i get a true, and i see "user1" as the current user.i know that what i have done above use a cookie,and as i know cookie are visible in the same domain (site) or sub domain,how form authentication make the cookie visible for both sites , this scenario must work for a site with two virtual directory inside it(sub site or application), but what is happening here any explanation.

View 5 Replies

RedirectFromLoginPage() Is Not Updating User.Identity.Name?

Jun 2, 2010

I use FormsAuthentication.RedirectFromLoginPage(userName.Trim(), false); to set the User.Identity.Name field that I reference later. When I execute this line, the User.Identity object does not update at all; it contains whatever it was previously set to. All the documentation I see online says this should update my User.Identity object with the correct name, but I don't see that happening.

I have the web config set up properly with the following lines:

<authentication mode="Forms">
<forms name="formsauth" loginUrl="Login.aspx" protection="All" timeout="60">
</forms>
</authentication>
<authorization>
<deny users="?"/>
</authorization>

View 1 Replies

FormsAuthentication.SetAuthCookie?

Aug 15, 2010

the question is how can i delete a coockie that is created with FormsAuthentication.SetAuthCookie?and how can i set the coockie to have more duration?

View 39 Replies

FormsAuthentication Behaving Odd?

Feb 27, 2011

Is this a security issue or by design?string UID = "randomusername" // does not exists in aspnet_Users table
FormsAuthentication.RedirectFromLoginPage(UID, false);Authenticates users, redirects to login page.Profile Page is set to chech User.Identity.IsAuthenticated etc...when they update the profile, it ads the user to the aspnet_users table automatically, which is not what I want.

View 1 Replies

.net - Possible To Programmatically Set FormsAuthentication.FormsCookieName?

Jan 10, 2011

is it possible to set the FormsAuthentication.FormsCookieName in Codebehind(f.e. in Global.asax)? All properties that i have seen that lead to this config-parameter are readonly.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved