Click here to Skip to main content
15,885,098 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionHow to open document in asp.net? Pin
JC.KaNNaN24-Jan-10 2:09
JC.KaNNaN24-Jan-10 2:09 
AnswerRe: How to open document in asp.net? Pin
Not Active24-Jan-10 2:28
mentorNot Active24-Jan-10 2:28 
GeneralRe: How to open document in asp.net? Pin
JC.KaNNaN24-Jan-10 23:18
JC.KaNNaN24-Jan-10 23:18 
GeneralRe: How to open document in asp.net? Pin
Not Active25-Jan-10 1:13
mentorNot Active25-Jan-10 1:13 
QuestionVisual Studio Web Developer 2008 Pin
Roy Shoa24-Jan-10 1:11
Roy Shoa24-Jan-10 1:11 
QuestionProblem showing the correct value in a gridview Pin
AndyASPVB24-Jan-10 0:59
AndyASPVB24-Jan-10 0:59 
AnswerRe: Problem showing the correct value in a gridview Pin
Not Active24-Jan-10 2:33
mentorNot Active24-Jan-10 2:33 
QuestionFormsAuthentication.SetAuthCookie not working??? or is my logic wrong? [modified] Pin
wilsonmanmcp24-Jan-10 0:19
wilsonmanmcp24-Jan-10 0:19 
Hi there,

I have a login.aspx which has a login control which works fine using Form Auth using SqlMemberProvider

<location path="Secure">
<system.web>
<authorization>
<deny users="?"/>
</authorization>
</system.web>
</location>

<authentication mode="Forms">
<forms loginUrl="Login.aspx" defaultUrl="~\Secure\ViewOrder.aspx" />
</authentication>
<sessionState timeout="30 /sessionState>
<authorization>
<allow users="*"/>
</authorization>
<membership defaultProvider="SqlMemberProvider">


but now I want to add in a Autologin page which takes a username query string and automatically authenicate the user.


Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If page.querystring("username") = "" Then
Response.Redirect("Login.aspx")
Else
Dim username As String = page.querystring("username")
Dim mu As MembershipUser = Membership.GetUser(username)
If Membership.ValidateUser(username, mu.GetPassword()) Then
If page.querystring("ReturnUrl") <> "" Then
FormsAuthentication.RedirectFromLoginPage(username, False)
Else
FormsAuthentication.SetAuthCookie(username, True)
Response.Redirect("~\secure\vieworder.aspx")
End If
Else
'some action if failed
End If
End If
End Sub

but don't know why the Response.Redirect("~\secure\vieworder.aspx") redirects me back to the original login page.... looks like the setauthcookie is not authenicating the passed in user properly?

any help would be appreciated.

thanks,

Still a newbie.. learning

modified on Sunday, January 24, 2010 6:04 PM

AnswerRe: FormsAuthentication.SetAuthCookie not working??? or is my logic wrong? Pin
Not Active24-Jan-10 2:35
mentorNot Active24-Jan-10 2:35 
AnswerRe: FormsAuthentication.SetAuthCookie not working??? or is my logic wrong? Pin
meeram39524-Jan-10 6:01
meeram39524-Jan-10 6:01 
AnswerRe: FormsAuthentication.SetAuthCookie not working??? or is my logic wrong? Pin
wilsonmanmcp24-Jan-10 12:07
wilsonmanmcp24-Jan-10 12:07 
AnswerRe: FormsAuthentication.SetAuthCookie not working??? or is my logic wrong? Pin
wilsonmanmcp25-Jan-10 0:32
wilsonmanmcp25-Jan-10 0:32 
QuestionASP.NET Cyrilic problem in DB Pin
hed_kandi23-Jan-10 22:29
hed_kandi23-Jan-10 22:29 
AnswerRe: ASP.NET Cyrilic problem in DB Pin
Not Active24-Jan-10 2:31
mentorNot Active24-Jan-10 2:31 
QuestionEncrypting The string Pin
RajpootRohan23-Jan-10 21:26
professionalRajpootRohan23-Jan-10 21:26 
AnswerRe: Encrypting The string [modified] Pin
Garth J Lancaster23-Jan-10 21:51
professionalGarth J Lancaster23-Jan-10 21:51 
Questionmodal popup extender Pin
Hemant Thaker23-Jan-10 7:29
Hemant Thaker23-Jan-10 7:29 
AnswerRe: modal popup extender Pin
Not Active23-Jan-10 8:18
mentorNot Active23-Jan-10 8:18 
GeneralRe: modal popup extender Pin
Hemant Thaker23-Jan-10 9:17
Hemant Thaker23-Jan-10 9:17 
QuestionHow to perform this requirement Pin
Nath23-Jan-10 5:50
Nath23-Jan-10 5:50 
AnswerRe: How to perform this requirement Pin
thatraja23-Jan-10 7:05
professionalthatraja23-Jan-10 7:05 
GeneralRe: How to perform this requirement Pin
Not Active23-Jan-10 8:12
mentorNot Active23-Jan-10 8:12 
GeneralRe: How to perform this requirement Pin
thatraja23-Jan-10 9:14
professionalthatraja23-Jan-10 9:14 
GeneralRe: How to perform this requirement Pin
Not Active23-Jan-10 9:33
mentorNot Active23-Jan-10 9:33 
GeneralRe: How to perform this requirement Pin
thatraja23-Jan-10 10:17
professionalthatraja23-Jan-10 10:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.