Is there a way to remove the "Create New User" from the login page? I have gone through the code and dont see anywhere it is referenced. I dont want just anybody bringing up the login page and adding themselves into it.
The Login control has CreateUserUrl and CreateUserText properties that you probably want to reset / remove from the control. These cause the signup link to appear.
Thanks for the response. When I am design view for Time Tracker, the create user link is not there. It only shows up when I run the website? Also those properties you mentioned are all blank.
Imports System
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls
Imports System.Collections.Generic
Imports ASPNET.StarterKit.BusinessLogicLayer
Imports System.Net.Mail
Imports System.Data.SqlClient
Imports System.IO
Partial Public Class Login_aspx
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load
Dim isAllowUserCreationForAnonymousUsers As String = ConfigurationManager.AppSettings("AllowUserCreationForAnonymousUsers")
If String.IsNullOrEmpty(isAllowUserCreationForAnonymousUsers) Then
Return
End If
If Page.User.Identity.IsAuthenticated OrElse ((Not Page.User.Identity.IsAuthenticated) AndAlso String.Compare(isAllowUserCreationForAnonymousUsers, "1") = 0) Then
Login1.CreateUserText = "Create new user"
Login1.CreateUserUrl = "~/TimeTracker/User_Create.aspx"
End If
End Sub
End Class
@ Page Language="VB" AutoEventWireup="true" MasterPageFile="~/TimeTracker/MasterPage.master" CodeFile="Login.aspx.vb"
Inherits="Login_aspx" Title="My Company - Time Tracker - Site Logon" Culture="auto" UICulture="auto" %>
<asp:Content ID="Content1" ContentPlaceHolderID="maincontent" runat="Server">
<div id="adminedit">
<fieldset style="height: auto; width: 252px;">
<!-- add H2 here and hide it with css since you can not put h2 inside a legend tag -->
<h2 class="none">
User Login</h2>
<legend>User Login</legend>
<asp:Login ID="Login1" runat="server">
<LoginButtonStyle CssClass="submit" />
</asp:Login>
</fieldset>
</div>
</asp:Content>
Thanks for your help, Below is the html and vb code. Again I dont see it in the designer but when I run it the create new user is there on the login control.
MKozlowski
Member
500 Points
573 Posts
Remove the create new user from the login page?
Nov 19, 2010 05:30 PM|LINK
Hi,
Is there a way to remove the "Create New User" from the login page? I have gone through the code and dont see anywhere it is referenced. I dont want just anybody bringing up the login page and adding themselves into it.
Thanks!
Imar_Spaanja...
Contributor
2784 Points
481 Posts
ASPInsiders
MVP
Re: Remove the create new user from the login page?
Nov 20, 2010 08:49 AM|LINK
Hi there,
The Login control has CreateUserUrl and CreateUserText properties that you probably want to reset / remove from the control. These cause the signup link to appear.
If that doesn't help, can you post your code?
Hope this helps,
Imar
My Blog - My Company
MKozlowski
Member
500 Points
573 Posts
Re: Remove the create new user from the login page?
Nov 22, 2010 12:24 PM|LINK
Thanks for the response. When I am design view for Time Tracker, the create user link is not there. It only shows up when I run the website? Also those properties you mentioned are all blank.
Thanks!
Imar_Spaanja...
Contributor
2784 Points
481 Posts
ASPInsiders
MVP
Re: Remove the create new user from the login page?
Nov 22, 2010 12:31 PM|LINK
In that case, can you show the markup and code behind of the page?
Imar
My Blog - My Company
MKozlowski
Member
500 Points
573 Posts
Re: Remove the create new user from the login page?
Nov 22, 2010 04:12 PM|LINK
Imports System Imports System.Data Imports System.Configuration Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Imports System.Collections.Generic Imports ASPNET.StarterKit.BusinessLogicLayer Imports System.Net.Mail Imports System.Data.SqlClient Imports System.IO Partial Public Class Login_aspx Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load Dim isAllowUserCreationForAnonymousUsers As String = ConfigurationManager.AppSettings("AllowUserCreationForAnonymousUsers") If String.IsNullOrEmpty(isAllowUserCreationForAnonymousUsers) Then Return End If If Page.User.Identity.IsAuthenticated OrElse ((Not Page.User.Identity.IsAuthenticated) AndAlso String.Compare(isAllowUserCreationForAnonymousUsers, "1") = 0) Then Login1.CreateUserText = "Create new user" Login1.CreateUserUrl = "~/TimeTracker/User_Create.aspx" End If End Sub End Class@ Page Language="VB" AutoEventWireup="true" MasterPageFile="~/TimeTracker/MasterPage.master" CodeFile="Login.aspx.vb" Inherits="Login_aspx" Title="My Company - Time Tracker - Site Logon" Culture="auto" UICulture="auto" %> <asp:Content ID="Content1" ContentPlaceHolderID="maincontent" runat="Server"> <div id="adminedit"> <fieldset style="height: auto; width: 252px;"> <!-- add H2 here and hide it with css since you can not put h2 inside a legend tag --> <h2 class="none"> User Login</h2> <legend>User Login</legend> <asp:Login ID="Login1" runat="server"> <LoginButtonStyle CssClass="submit" /> </asp:Login> </fieldset> </div> </asp:Content>Thanks for your help, Below is the html and vb code. Again I dont see it in the designer but when I run it the create new user is there on the login control.
MKozlowski
Member
500 Points
573 Posts
Re: Remove the create new user from the login page?
Nov 22, 2010 04:16 PM|LINK
I got it working, I had to change the value in webconfig to 0 Thank you for your help
<
add key="AllowUserCreationForAnonymousUsers" value="0"/>