cancel
Showing results for 
Search instead for 
Did you mean: 

Customised Login Block required elsewhere in Website

Former Member
0 Kudos

Hi,

I have a Webtools website with a home page (index.html) which has a custom login panel ( standard stuff : username and password with CSS applied formatting)

I need to link the Webtools login/logout functionality to this HTML block.

I'm guessing but assume one way would be to wrap the existing page in a master page and include a loginblock plugin. (Initial attempts to enclose it in the default webtools common.master caused problems running some of the Javascript that exists on the homepage but these could perhaps be worked around)

I'm not sure what ascx file the loginblock is referencing if at all but I'll need to be able to 'theme' the block and customise it:

- to include a re-direct to a specified page other than myaccount.aspx on succesful login.

- to remove the MyAccount hyperlink and possibly change the 'welcome back' text

Is there an alternative to achieve what I need by including code and webtools controls within the existing index.html page ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Geoff,

First, the loginblock.ascx is expecting to live on a page that inherits NPBasePage. That is where the Login() method lives. That may be why you are failing.

Beyond that, there is no code behind for this plugin, so everything is (semi) transparent.

The two key "invisible" code elements are NPBasePage.Login, which sets the cookie and does the redirect to account.aspx, and the .NET MembershipProvider, which does all of the security stuff.

The hyperlink you can just remove from the control.

The text can be editted using the string editor located at the top of the menu when you login with someone in the superuser role. The string editor is accessed by clicking the icon next to the help above the menu. Hopefully you can get it from there.

The hard part is the redirect, since this is hardcoded in NPBasePage.Login(). This method will redirect to a page if the ReturnTo argument is in the URL. If you are in control of how they get to this page, you can simply add the follwing arg...


ReturnTo=~/mynextpage.aspx"

If they are getting here from a number of locations, you could do a redirect in the Page_Load and append the arg to the URL. This is a kludge but it should work fine.

Former Member
0 Kudos

Shane- I haven't tried anything yet so haven't in fact failed but I wanted to check this out first before I tried.

I gather from your answer I'll have to re-do the index.html page as an aspx page inheriting from NPBasePage

I''ll give this a go and then look at the redirect.

Former Member
0 Kudos

That is correct.

You should be able to copy and past your existing page.

You can look at sampleform1.aspx in the plugins directory for a guide, if you have not done this before.

NPBasePage is behind every page in Webtools. It has a number of handy helper functions and properties (like the connection string, logged in UserID and AccountID) as well as the login.

The theme/slots are built by common.master. So if you do not want that, you can change the master page to default.master.

Former Member
0 Kudos

Hello Geoff,

Why not just customize default.aspx?

Answers (0)