Aspnetsqlmembership user of FBA site in custom login page in SharePoint 2007
Hi Ravi, Did you used FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false) ?? Please check the code for the login button in my custom Login.aspx page. protected void btnLogin_Click(object sender, EventArgs e) { if (Membership.ValidateUser(txtUserName.Text, txtPassword.Text)) { // Do Secure ID thing here. // Redirect the user to the requested page. FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, false); } else lblError.Text = "The credentials you entered are not valid. " + "Please try again."; } This should do the work.Thanks, Chanakya
March 9th, 2011 11:27pm

I have an FBA site with AspNetSqlMemberShip provider for user management. Also I have created a custom login page. I can verify the user name and password with Membership.ValidateUser(txtUsername.Text, EncryptString(txtPassword.Text,true)) method but I am not able to login the user SharePoint Application. I am not able to set the current login username verified in login page. Is there any way to set the username for the current context? Or there is any method to login the user in SharePoint from custom login page as default login page works. Thanks in Advance. Ravi Patil
Free Windows Admin Tool Kit Click here and download it now
March 10th, 2011 12:33am

Set Forms Authentication Cookie after user validation like below if (Membership.ValidateUser(txtUserName.Text, txtPassword.Text)) { FormsAuthentication.SetAuthCookie(txtUserName.Text, true); } w: http://www.worldofsharepoint.com | t: @sharesandip
March 10th, 2011 12:52am

Hi Chanakya, Thanks a lot for the help. But there is one thing that it redirects me to default.aspx of SharePoint, I want to redirect the user to a another custom page, so it can be achievable? Thank again. Ravi Patil
Free Windows Admin Tool Kit Click here and download it now
March 10th, 2011 12:53am

In that case you can write a script to redirect to the custom page and place it in a CWEP webpart in default.aspx. This is much simpler method. <script> function doRedirect() { window.location.replace( '/sites/customdefault.aspx'); } doRedirect(); </script> Other way is by changing the actual default page to point to your custom page. Check it here http://attis.org/blogs/dan/archive/2008/10/29/how-to-change-the-default-page-of-a-sharepoint-site-using-a-feature.aspxThanks, Chanakya
March 10th, 2011 1:00am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics