UserExists (WebSecurity Ref)

The UserExists method takes one string argument and checks to see if the user exists. It returns Boolean, so true or false.


Sponsored Links

C# Code

string username = "";
string msg = "";

if (IsPost)
    username = Request["username"];
    if (WebSecurity.UserExists(username))
        msg = "User Found!";
        msg = "Cannot find user!";



<!DOCTYPE html>
<html lang="en">
        <meta charset="utf-8" />
        <form method="post">
            <input type="text" name="username"/>
                   <input type="submit"/>