<%@ Page Language="VB" %>
<script runat="server">
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Try
Membership.CreateUser(TextBox1.Text, TextBox2.Text)
Label1.Text = "Successfully created user " & TextBox1.Text
Catch ex As MembershipCreateUserException
Label1.Text = "Error: " & ex.ToString()
End Try
End Sub
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Creating a User</title>
</head>
<body>
<form id="form1" runat="server">
<h1>Create User</h1>
Username<br />
<asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox>
Password<br />
<asp:TextBox ID="TextBox2" Runat="server"
TextMode="Password"></asp:TextBox>
<asp:Button ID="Button1" Runat="server" Text="Create User"
OnClick="Button1_Click" />
<asp:Label ID="Label1" Runat="server"></asp:Label>
</form>
</body>
</html>
|