Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Umbraco User's Guide
This is the forum to discuss the Wrox book Umbraco User's Guide by Nik Wahlberg, Paul Sterling; ISBN: 978-0-470-56082-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Umbraco User's Guide section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old August 28th, 2013, 02:24 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy Login Macro

Hi All -

You can find the Login Macro on Page 244 - 246.

I have a client using Umbraco 4.7.1. They requested a login page for board members. I followed the book: made the required web.config change (DefaultMemberTypeAlias attribute match one of my configured Member types). Then I created the login.ascx page, copied the code from the book on the front end and code behind pages(see below). I compiled, went into Umbraco and created the login Macro, told it to use the .NET User Control Login.ascx. Then I added that Macro to a page. Added a protected page, told the protected page to go to the page with the login macro as a login page. It goes to the correct page, and I can see the control fine. However, nothing happens when I click 'login'. I have a user created. Any guidance would be helpful.

Login.ascx
Code:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Login.ascx.cs" Inherits="LifeSkills.usercontrols.Login" %>
<asp:Login ID="_loginForm" runat="server">
</asp:Login>
Login.ascx.cs
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace LifeSkills.usercontrols
{
    public partial class Login : System.Web.UI.UserControl
    {
        //The default redirect page after loggin in
        public int LoginRedirectPage { get; set; }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            _loginForm.LoggedIn += LoginUser_LoggedIn;
        }

        //When the user has successfully authenticated redirect to the specified page
        void LoginUser_LoggedIn(object sender, EventArgs e)
        {
            Response.Redirect(umbraco.library.NiceUrl(LoginRedirectPage));
        }

        protected void Page_Load(object sender, EventArgs e)
        {
        }
    }
}
Reply With Quote
  #2 (permalink)  
Old August 29th, 2013, 12:28 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey Everyone,

I figured out my issue. The previous vender for this client had nested form tags on the master page that was causing no postback on my button click. Found help with this forum: http://our.umbraco.org/forum/core/ge...ontrol-Umbraco
Reply With Quote
  #3 (permalink)  
Old August 29th, 2013, 02:24 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Working but not redirecting

I have the login working now

Now my issue is, though I am logged in, I am still redirected to the login page with the control still there, so I think I still need to log in. I realized that I was logged in when I tried to go to the protected page and it loaded with no error/login page showing.

Is the redirect now working or is it not correct? Shouldn't the "LoginRedirectPage" have a value of my protected page?
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Cannot implicitly convert type 'Login' to 'System.Web.UI.WebControls.Login' fh84 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 January 23rd, 2009 10:17 AM
calling to xlam macro from macro inside xlsb SteveB Excel VBA 0 June 30th, 2008 06:43 PM
login failed for user nt authority\anonymous login rj1406 Classic ASP Databases 1 October 24th, 2004 09:15 AM



All times are GMT -4. The time now is 07:13 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.